File tree 5 files changed +60
-0
lines changed
src/components/typography 5 files changed +60
-0
lines changed Original file line number Diff line number Diff line change @@ -5,3 +5,5 @@ export * from "./h2";
5
5
export * from "./h3" ;
6
6
export * from "./hr" ;
7
7
export * from "./p" ;
8
+ export * from "./placeholder" ;
9
+ export * from "./ul" ;
Original file line number Diff line number Diff line change
1
+ export * from "./placeholder" ;
Original file line number Diff line number Diff line change
1
+ .mykn-placeholder {
2
+ --mykn-placeholder-color-dark : var (--typography-color-border );
3
+ --mykn-placeholder-color-light : var (--typography-color-background-alt );
4
+
5
+ animation : shift- background var (--animation-duration-slow ) infinite
6
+ var (--animation-timing-function ) reverse ;
7
+ background : linear-gradient (
8
+ 90deg ,
9
+ var (--mykn-placeholder-color-dark ),
10
+ var (--mykn-placeholder-color-light ),
11
+ var (--mykn-placeholder-color-dark )
12
+ );
13
+ background-size : 200% 100% ;
14
+ border : none ;
15
+ border-radius : 1em ;
16
+ display : inline-block ;
17
+ height : 1em ;
18
+ margin : 0 ;
19
+ overflow : hidden ;
20
+ position : relative ;
21
+ width : 100% ;
22
+ }
23
+
24
+ @keyframes shift-background {
25
+ 0% {
26
+ background-position : 0% 0% ;
27
+ }
28
+ 100% {
29
+ background-position : 200% 0% ;
30
+ }
31
+ }
Original file line number Diff line number Diff line change
1
+ import type { Meta , StoryObj } from "@storybook/react" ;
2
+
3
+ import { Placeholder } from "./placeholder" ;
4
+
5
+ const meta : Meta < typeof Placeholder > = {
6
+ title : "Typography/Placeholder" ,
7
+ component : Placeholder ,
8
+ } ;
9
+
10
+ export default meta ;
11
+ type Story = StoryObj < typeof meta > ;
12
+
13
+ export const PlaceholderComponent : Story = { } ;
Original file line number Diff line number Diff line change
1
+ import clsx from "clsx" ;
2
+ import React from "react" ;
3
+
4
+ import "./placeholder.scss" ;
5
+
6
+ export type PlaceholderProps = React . ComponentProps < "hr" > ;
7
+
8
+ /**
9
+ * Placeholder component, indicates that content is loading.
10
+ */
11
+ export const Placeholder : React . FC < PlaceholderProps > = ( { ...props } ) => (
12
+ < hr className = { clsx ( "mykn-placeholder" ) } aria-hidden = { true } { ...props } />
13
+ ) ;
You can’t perform that action at this time.
0 commit comments