@fpkit/acss 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +52 -0
- package/dist/chunk-77CZU5XZ.cjs +9 -0
- package/dist/chunk-77CZU5XZ.cjs.map +1 -0
- package/dist/chunk-D43FJIRQ.cjs +31 -0
- package/dist/chunk-D43FJIRQ.cjs.map +1 -0
- package/dist/chunk-GJWMCDFS.js +9 -0
- package/dist/chunk-GJWMCDFS.js.map +1 -0
- package/dist/chunk-PCDUGD3C.js +5 -0
- package/dist/chunk-PCDUGD3C.js.map +1 -0
- package/dist/hooks.cjs +10 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.d.cts +32 -0
- package/dist/hooks.d.ts +32 -0
- package/dist/hooks.js +8 -0
- package/dist/hooks.js.map +1 -0
- package/dist/icon-e6044c73.d.ts +227 -0
- package/dist/icons.cjs +73 -0
- package/dist/icons.cjs.map +1 -0
- package/dist/icons.d.cts +252 -0
- package/dist/icons.d.ts +252 -0
- package/dist/icons.js +4 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.cjs +59 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +566 -0
- package/dist/index.d.ts +566 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/libs/chunk-GCGKYLDG.js +7 -0
- package/libs/chunk-GCGKYLDG.js.map +1 -0
- package/libs/chunk-PDD4N5P5.cjs +10 -0
- package/libs/chunk-PDD4N5P5.cjs.map +1 -0
- package/libs/chunk-QHIABQNQ.js +8 -0
- package/libs/chunk-QHIABQNQ.js.map +1 -0
- package/libs/chunk-ZOHIKF6I.cjs +31 -0
- package/libs/chunk-ZOHIKF6I.cjs.map +1 -0
- package/libs/components/badge/badge.css +1 -0
- package/libs/components/badge/badge.css.map +1 -0
- package/libs/components/badge/badge.min.css +3 -0
- package/libs/components/breadcrumbs/breadcrumb.css +1 -0
- package/libs/components/breadcrumbs/breadcrumb.css.map +1 -0
- package/libs/components/breadcrumbs/breadcrumb.min.css +3 -0
- package/libs/components/buttons/button.css +1 -0
- package/libs/components/buttons/button.css.map +1 -0
- package/libs/components/buttons/button.min.css +3 -0
- package/libs/components/cards/card-style.css +1 -0
- package/libs/components/cards/card-style.css.map +1 -0
- package/libs/components/cards/card-style.min.css +3 -0
- package/libs/components/cards/card.css +1 -0
- package/libs/components/cards/card.css.map +1 -0
- package/libs/components/cards/card.min.css +3 -0
- package/libs/components/details/details.css +1 -0
- package/libs/components/details/details.css.map +1 -0
- package/libs/components/details/details.min.css +3 -0
- package/libs/components/form/form.css +1 -0
- package/libs/components/form/form.css.map +1 -0
- package/libs/components/form/form.min.css +3 -0
- package/libs/components/icons/icon.css +1 -0
- package/libs/components/icons/icon.css.map +1 -0
- package/libs/components/icons/icon.min.css +3 -0
- package/libs/components/images/img.css +1 -0
- package/libs/components/images/img.css.map +1 -0
- package/libs/components/images/img.min.css +3 -0
- package/libs/components/layout/landmarks.css +1 -0
- package/libs/components/layout/landmarks.css.map +1 -0
- package/libs/components/layout/landmarks.min.css +3 -0
- package/libs/components/link/link.css +1 -0
- package/libs/components/link/link.css.map +1 -0
- package/libs/components/link/link.min.css +3 -0
- package/libs/components/nav/nav.css +1 -0
- package/libs/components/nav/nav.css.map +1 -0
- package/libs/components/nav/nav.min.css +3 -0
- package/libs/components/progress/progress.css +1 -0
- package/libs/components/progress/progress.css.map +1 -0
- package/libs/components/progress/progress.min.css +3 -0
- package/libs/components/styles/index.css +1 -0
- package/libs/components/styles/index.css.map +1 -0
- package/libs/components/styles/index.min.css +3 -0
- package/libs/components/tag/tag.css +1 -0
- package/libs/components/tag/tag.css.map +1 -0
- package/libs/components/tag/tag.min.css +3 -0
- package/libs/components/text-to-speech/text-to-speech.css +1 -0
- package/libs/components/text-to-speech/text-to-speech.css.map +1 -0
- package/libs/components/text-to-speech/text-to-speech.min.css +3 -0
- package/libs/hooks.cjs +12 -0
- package/libs/hooks.cjs.map +1 -0
- package/libs/hooks.d.cts +32 -0
- package/libs/hooks.d.ts +32 -0
- package/libs/hooks.js +3 -0
- package/libs/hooks.js.map +1 -0
- package/libs/icons-1f5afc0c.d.ts +318 -0
- package/libs/icons.cjs +12 -0
- package/libs/icons.cjs.map +1 -0
- package/libs/icons.d.cts +2 -0
- package/libs/icons.d.ts +2 -0
- package/libs/icons.js +3 -0
- package/libs/icons.js.map +1 -0
- package/libs/index.cjs +71 -0
- package/libs/index.cjs.map +1 -0
- package/libs/index.css +1 -0
- package/libs/index.css.map +1 -0
- package/libs/index.d.cts +551 -0
- package/libs/index.d.ts +551 -0
- package/libs/index.js +11 -0
- package/libs/index.js.map +1 -0
- package/package.json +125 -0
- package/src/App.css +42 -0
- package/src/App.tsx +35 -0
- package/src/__snapshots__/App.test.tsx.snap +56 -0
- package/src/components/.gitkeep +0 -0
- package/src/components/__snapshots__/fp.test.tsx.snap +3 -0
- package/src/components/badge/badge.scss +20 -0
- package/src/components/badge/badge.stories.tsx +54 -0
- package/src/components/badge/badge.tsx +17 -0
- package/src/components/breadcrumbs/bc-item.tsx +20 -0
- package/src/components/breadcrumbs/breadcrumb.scss +35 -0
- package/src/components/breadcrumbs/breadcrumb.stories.tsx +92 -0
- package/src/components/breadcrumbs/breadcrumb.tsx +218 -0
- package/src/components/buttons/button.scss +115 -0
- package/src/components/buttons/button.stories.tsx +57 -0
- package/src/components/buttons/button.test.tsx +104 -0
- package/src/components/buttons/button.tsx +64 -0
- package/src/components/cards/card-style.scss +0 -0
- package/src/components/cards/card.scss +43 -0
- package/src/components/cards/card.stories.tsx +114 -0
- package/src/components/cards/card.test.tsx +30 -0
- package/src/components/cards/card.tsx +135 -0
- package/src/components/cards/flex-card.tsx +15 -0
- package/src/components/details/details.scss +75 -0
- package/src/components/details/details.stories.tsx +122 -0
- package/src/components/details/details.tsx +77 -0
- package/src/components/form/README.mdx +70 -0
- package/src/components/form/fields.tsx +45 -0
- package/src/components/form/form.scss +87 -0
- package/src/components/form/form.stories.tsx +49 -0
- package/src/components/form/form.tsx +71 -0
- package/src/components/form/input.stories.tsx +155 -0
- package/src/components/form/inputs.tsx +84 -0
- package/src/components/form/select.stories.tsx +38 -0
- package/src/components/form/select.tsx +112 -0
- package/src/components/form/textarea.tsx +87 -0
- package/src/components/fp.test.tsx +56 -0
- package/src/components/fp.tsx +78 -0
- package/src/components/heading/heading.stories.tsx +75 -0
- package/src/components/heading/heading.tsx +27 -0
- package/src/components/icons/components/add.tsx +42 -0
- package/src/components/icons/components/arrow-down.tsx +52 -0
- package/src/components/icons/components/arrow-left.tsx +49 -0
- package/src/components/icons/components/arrow-right.tsx +52 -0
- package/src/components/icons/components/arrow-up.tsx +49 -0
- package/src/components/icons/components/chat.tsx +44 -0
- package/src/components/icons/components/code.tsx +50 -0
- package/src/components/icons/components/copy.tsx +51 -0
- package/src/components/icons/components/down.tsx +33 -0
- package/src/components/icons/components/home.tsx +57 -0
- package/src/components/icons/components/left.tsx +43 -0
- package/src/components/icons/components/minus.tsx +42 -0
- package/src/components/icons/components/pause-solid.tsx +48 -0
- package/src/components/icons/components/pause.tsx +63 -0
- package/src/components/icons/components/play-solid.tsx +44 -0
- package/src/components/icons/components/play.tsx +51 -0
- package/src/components/icons/components/remove.tsx +42 -0
- package/src/components/icons/components/resume-solid.tsx +52 -0
- package/src/components/icons/components/resume.tsx +57 -0
- package/src/components/icons/components/right.tsx +43 -0
- package/src/components/icons/components/star.tsx +38 -0
- package/src/components/icons/components/stop-solid.tsx +44 -0
- package/src/components/icons/components/stop.tsx +54 -0
- package/src/components/icons/components/svg.tsx +44 -0
- package/src/components/icons/components/up.tsx +31 -0
- package/src/components/icons/components/user.tsx +46 -0
- package/src/components/icons/icon.scss +15 -0
- package/src/components/icons/icon.stories.tsx +208 -0
- package/src/components/icons/icon.tsx +100 -0
- package/src/components/icons/index.ts +29 -0
- package/src/components/icons/types.ts +12 -0
- package/src/components/images/README.mdx +43 -0
- package/src/components/images/figure.stories.tsx +34 -0
- package/src/components/images/figure.tsx +44 -0
- package/src/components/images/img.scss +43 -0
- package/src/components/images/img.stories.tsx +24 -0
- package/src/components/images/img.test.tsx +43 -0
- package/src/components/images/img.tsx +93 -0
- package/src/components/images/place-holder.png +0 -0
- package/src/components/kit.tsx +56 -0
- package/src/components/layout/_header.scss +72 -0
- package/src/components/layout/footer.stories.tsx +34 -0
- package/src/components/layout/landmarks.scss +51 -0
- package/src/components/layout/landmarks.stories.tsx +54 -0
- package/src/components/layout/landmarks.tsx +149 -0
- package/src/components/layout/main.stories.tsx +90 -0
- package/src/components/link/link.scss +92 -0
- package/src/components/link/link.stories.tsx +74 -0
- package/src/components/link/link.tsx +48 -0
- package/src/components/list/list.stories.tsx +52 -0
- package/src/components/list/list.tsx +74 -0
- package/src/components/modal/dialog.tsx +50 -0
- package/src/components/modal/modal.tsx +85 -0
- package/src/components/nav/nav.scss +90 -0
- package/src/components/nav/nav.stories.tsx +96 -0
- package/src/components/nav/nav.tsx +76 -0
- package/src/components/popover/node_modules/.vitest/results.json +1 -0
- package/src/components/popover/popover.stories.tsx +31 -0
- package/src/components/popover/popover.test.tsx +39 -0
- package/src/components/popover/popover.tsx +85 -0
- package/src/components/progress/progress.scss +70 -0
- package/src/components/progress/progress.stories.tsx +51 -0
- package/src/components/progress/progress.tsx +82 -0
- package/src/components/readme.stories.mdx +7 -0
- package/src/components/styles/index.css +520 -0
- package/src/components/styles/index.css.map +1 -0
- package/src/components/tables/table-elements.tsx +57 -0
- package/src/components/tables/table.tsx +57 -0
- package/src/components/tag/tag.scss +56 -0
- package/src/components/tag/tag.stories.tsx +39 -0
- package/src/components/tag/tag.tsx +25 -0
- package/src/components/text/text.stories.tsx +67 -0
- package/src/components/text/text.tsx +93 -0
- package/src/components/text-to-speech/README.mdx +192 -0
- package/src/components/text-to-speech/TextInput.tsx +19 -0
- package/src/components/text-to-speech/TextToSpeech.stories.tsx +145 -0
- package/src/components/text-to-speech/TextToSpeech.tsx +94 -0
- package/src/components/text-to-speech/text-to-speech.scss +31 -0
- package/src/components/text-to-speech/useTextToSpeech.mdx +182 -0
- package/src/components/text-to-speech/useTextToSpeech.tsx +176 -0
- package/src/components/text-to-speech/views/TextToSpeechControls.tsx +117 -0
- package/src/components/ui.tsx +67 -0
- package/src/favicon.svg +15 -0
- package/src/hooks/popover/__snapshots__/popover.test.tsx.snap +88 -0
- package/src/hooks/popover/node_modules/.vitest/results.json +1 -0
- package/src/hooks/popover/popover.tsx +71 -0
- package/src/hooks/popover/use-popover.tsx +83 -0
- package/src/hooks.ts +1 -0
- package/src/icons.ts +1 -0
- package/src/index.css +13 -0
- package/src/index.scss +19 -0
- package/src/index.ts +35 -0
- package/src/libs/content.ts +30 -0
- package/src/logo.svg +7 -0
- package/src/main.tsx +10 -0
- package/src/patterns/.gitkeep +0 -0
- package/src/patterns/page/page-header.stories.tsx +44 -0
- package/src/patterns/page/page-header.tsx +78 -0
- package/src/sass/_elements.scss +17 -0
- package/src/sass/_globals.scss +162 -0
- package/src/sass/_layout.scss +51 -0
- package/src/sass/_loading-animation.scss +35 -0
- package/src/sass/_mixins.scss +10 -0
- package/src/sass/_properties.scss +106 -0
- package/src/sass/_reset.scss +183 -0
- package/src/sass/_type.scss +43 -0
- package/src/setupTest.ts +1 -0
- package/src/styles/badge/badge.css +22 -0
- package/src/styles/badge/badge.css.map +1 -0
- package/src/styles/breadcrumbs/breadcrumb.css +42 -0
- package/src/styles/breadcrumbs/breadcrumb.css.map +1 -0
- package/src/styles/buttons/button.css +93 -0
- package/src/styles/buttons/button.css.map +1 -0
- package/src/styles/cards/card-style.css +3 -0
- package/src/styles/cards/card-style.css.map +1 -0
- package/src/styles/cards/card.css +48 -0
- package/src/styles/cards/card.css.map +1 -0
- package/src/styles/details/details.css +69 -0
- package/src/styles/details/details.css.map +1 -0
- package/src/styles/dropdowns/dropdown.css.map +1 -0
- package/src/styles/form/form.css +93 -0
- package/src/styles/form/form.css.map +1 -0
- package/src/styles/form/style.css.map +1 -0
- package/src/styles/icons/icon.css +16 -0
- package/src/styles/icons/icon.css.map +1 -0
- package/src/styles/images/img.css +42 -0
- package/src/styles/images/img.css.map +1 -0
- package/src/styles/index.css +1330 -0
- package/src/styles/index.css.map +1 -0
- package/src/styles/layout/landmarks.css +155 -0
- package/src/styles/layout/landmarks.css.map +1 -0
- package/src/styles/link/link.css +88 -0
- package/src/styles/link/link.css.map +1 -0
- package/src/styles/nav/nav.css +85 -0
- package/src/styles/nav/nav.css.map +1 -0
- package/src/styles/progress/progress.css +54 -0
- package/src/styles/progress/progress.css.map +1 -0
- package/src/styles/progress/sass/progress.css.map +1 -0
- package/src/styles/styles/index.css +562 -0
- package/src/styles/styles/index.css.map +1 -0
- package/src/styles/tag/badge.css.map +1 -0
- package/src/styles/tag/tag.css +71 -0
- package/src/styles/tag/tag.css.map +1 -0
- package/src/styles/text-to-speech/text-to-speech.css +32 -0
- package/src/styles/text-to-speech/text-to-speech.css.map +1 -0
- package/src/test/setup.ts +6 -0
- package/src/types/component-props.ts +36 -0
- package/src/types/index.ts +2 -0
- package/src/types/input-props.ts +28 -0
- package/src/types/shared.ts +57 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
*,
|
|
2
|
+
*::before,
|
|
3
|
+
*::after {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
::selection {
|
|
8
|
+
/* Optional */
|
|
9
|
+
/* It can be really hard to read highlighted text with a text-shadow, it should be removed when selected */
|
|
10
|
+
text-shadow: none;
|
|
11
|
+
/* NOTE: Using this means the color and background-color are set to transparent for selected text... */
|
|
12
|
+
/* So you can customise your styles below */
|
|
13
|
+
color: #fff;
|
|
14
|
+
background-color: #00f;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
3. Allow percentage-based heights in the application
|
|
19
|
+
*/
|
|
20
|
+
html,
|
|
21
|
+
body {
|
|
22
|
+
height: 100%;
|
|
23
|
+
font-size: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Set core root defaults */
|
|
27
|
+
html:focus-within {
|
|
28
|
+
scroll-behavior: smooth;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Remove default margin */
|
|
32
|
+
body,
|
|
33
|
+
h1,
|
|
34
|
+
h2,
|
|
35
|
+
h3,
|
|
36
|
+
h4,
|
|
37
|
+
p,
|
|
38
|
+
figure,
|
|
39
|
+
blockquote,
|
|
40
|
+
dl,
|
|
41
|
+
dd {
|
|
42
|
+
margin: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
|
|
46
|
+
ul[role='list'],
|
|
47
|
+
ol[role='list'] {
|
|
48
|
+
list-style: none;
|
|
49
|
+
margin-block-end: 0;
|
|
50
|
+
margin-block-start: 0;
|
|
51
|
+
padding-inline-start: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Set core body defaults */
|
|
55
|
+
body {
|
|
56
|
+
min-height: 100vh;
|
|
57
|
+
text-rendering: optimizeSpeed;
|
|
58
|
+
line-height: 1.5;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* A elements that don't have a class get default styles */
|
|
62
|
+
a:not([class]) {
|
|
63
|
+
text-decoration-skip-ink: auto;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
a,
|
|
67
|
+
button {
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Make images easier to work with */
|
|
72
|
+
img,
|
|
73
|
+
picture,
|
|
74
|
+
video,
|
|
75
|
+
canvas {
|
|
76
|
+
display: block;
|
|
77
|
+
max-width: 100%;
|
|
78
|
+
aspect-ratio: auto;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
img,
|
|
82
|
+
video,
|
|
83
|
+
iframe {
|
|
84
|
+
max-inline-size: 100%;
|
|
85
|
+
block-size: auto;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
img {
|
|
89
|
+
max-width: 100%;
|
|
90
|
+
height: auto;
|
|
91
|
+
vertical-align: middle;
|
|
92
|
+
font-style: italic;
|
|
93
|
+
background-repeat: no-repeat;
|
|
94
|
+
background-size: cover;
|
|
95
|
+
shape-margin: 0.75rem;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
svg {
|
|
99
|
+
display: inline-block;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Inherit fonts for inputs and buttons */
|
|
103
|
+
input,
|
|
104
|
+
textarea,
|
|
105
|
+
select {
|
|
106
|
+
font-family: inherit;
|
|
107
|
+
font-size: inherit;
|
|
108
|
+
font-style: inherit;
|
|
109
|
+
font-weight: inherit;
|
|
110
|
+
font-variant: inherit;
|
|
111
|
+
line-height: inherit;
|
|
112
|
+
background-color: inherit;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* Inherit fonts for inputs and buttons */
|
|
116
|
+
:where(button) {
|
|
117
|
+
font-family: inherit;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
|
|
121
|
+
@media (prefers-reduced-motion: reduce) {
|
|
122
|
+
html:focus-within {
|
|
123
|
+
scroll-behavior: auto;
|
|
124
|
+
}
|
|
125
|
+
*,
|
|
126
|
+
*::before,
|
|
127
|
+
*::after {
|
|
128
|
+
animation-duration: 0.01ms !important;
|
|
129
|
+
animation-iteration-count: 1 !important;
|
|
130
|
+
transition-duration: 0.01ms !important;
|
|
131
|
+
scroll-behavior: auto !important;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/* Create a root stacking context */
|
|
135
|
+
#root,
|
|
136
|
+
#__next {
|
|
137
|
+
isolation: isolate;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
p,
|
|
141
|
+
h1,
|
|
142
|
+
h2,
|
|
143
|
+
h3,
|
|
144
|
+
h4,
|
|
145
|
+
h5,
|
|
146
|
+
h6 {
|
|
147
|
+
overflow-wrap: break-word;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
*:focus {
|
|
151
|
+
outline: none;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Removes spacing between cells in tables */
|
|
155
|
+
table {
|
|
156
|
+
border-collapse: collapse;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
svg {
|
|
160
|
+
max-width: inline-size;
|
|
161
|
+
/* Optional - make the SVG's fill be the same as the inherited color */
|
|
162
|
+
/* Prevent the SVG from altering cursor interaction */
|
|
163
|
+
pointer-events: none;
|
|
164
|
+
}
|
|
165
|
+
svg[role='img'] {
|
|
166
|
+
display: inline-flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
width: auto;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
:root {
|
|
172
|
+
--font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
|
173
|
+
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji',
|
|
174
|
+
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
175
|
+
--fs: 1rem;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
html {
|
|
179
|
+
font-family: var(--font-family);
|
|
180
|
+
font-size: var(--fs);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
main,
|
|
184
|
+
header,
|
|
185
|
+
footer {
|
|
186
|
+
font-size: var(--fs);
|
|
187
|
+
}
|
|
188
|
+
main > section,
|
|
189
|
+
header > section,
|
|
190
|
+
footer > section {
|
|
191
|
+
margin-inline: auto;
|
|
192
|
+
width: var(--content-w, 80%);
|
|
193
|
+
}
|
|
194
|
+
main > div,
|
|
195
|
+
header > div,
|
|
196
|
+
footer > div {
|
|
197
|
+
text-align: center;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
section:not(nav) {
|
|
201
|
+
margin-inline: var(--sect-y, auto);
|
|
202
|
+
padding-block: var(--sect-x, --spc-4);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
p {
|
|
206
|
+
font-size: var(--fs);
|
|
207
|
+
}
|
|
208
|
+
p + p {
|
|
209
|
+
margin-block-start: 1rem;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
button {
|
|
213
|
+
--btn-sm: calc(12rem / 16);
|
|
214
|
+
--btn-md: calc(16rem / 16);
|
|
215
|
+
--btn-lg: calc(21rem / 16);
|
|
216
|
+
--btn-pill: 100rem;
|
|
217
|
+
--btn-height: calc(40rem / 16);
|
|
218
|
+
--fs: 0.95rem;
|
|
219
|
+
--btn-fs: calc(15rem / 16);
|
|
220
|
+
--btn-bg: lightgray;
|
|
221
|
+
--btn-width: max-content;
|
|
222
|
+
font-size: var(--btn-fs);
|
|
223
|
+
font-weight: var(--btn-fw, 500);
|
|
224
|
+
height: var(--btn-height, 2.5rem);
|
|
225
|
+
min-height: var(--btn-height);
|
|
226
|
+
place-items: var(--btn-place, center);
|
|
227
|
+
padding-inline: var(--btn-px, calc(var(--btn-fs) + 1.1%));
|
|
228
|
+
padding-block: var(--btn-py, calc(var(--btn-fs) + 0.75%));
|
|
229
|
+
border: var(--btn-bdr, none);
|
|
230
|
+
border-radius: var(--btn-rds, 0.375rem);
|
|
231
|
+
text-decoration: var(--btn-deco, none);
|
|
232
|
+
color: var(--btn-cl, currentColor);
|
|
233
|
+
display: var(--btn-dsp, inline-flex);
|
|
234
|
+
gap: var(--btn-gap, 0.2rem);
|
|
235
|
+
white-space: var(--btn-wspc, inherit);
|
|
236
|
+
margin: var(--btn-spc, 0);
|
|
237
|
+
transition: var(--tran-all);
|
|
238
|
+
background-color: var(--btn-bg, var(--btn));
|
|
239
|
+
outline: none;
|
|
240
|
+
width: var(--btn-width);
|
|
241
|
+
}
|
|
242
|
+
button[type] {
|
|
243
|
+
background-color: var(--btn-bg, var(--neutral-300));
|
|
244
|
+
--btn-bdr: solid var(--btn-sg);
|
|
245
|
+
}
|
|
246
|
+
button[type='submit'],
|
|
247
|
+
button[style*='submit'] {
|
|
248
|
+
--btn-bg: var(--primary-500, royal-blue);
|
|
249
|
+
--btn-color: white;
|
|
250
|
+
}
|
|
251
|
+
button[disabled],
|
|
252
|
+
button[aria-disabled='true'] {
|
|
253
|
+
cursor: var(--btn-cursor, not-allowed);
|
|
254
|
+
opacity: var(--btn-opacity, 0.5);
|
|
255
|
+
}
|
|
256
|
+
button[disabled]:is(:hover, :focus),
|
|
257
|
+
button[aria-disabled='true']:is(:hover, :focus) {
|
|
258
|
+
transform: none;
|
|
259
|
+
opacity: var(--btn-opacity, 0.5);
|
|
260
|
+
}
|
|
261
|
+
button:is(:hover, :focus) {
|
|
262
|
+
--btn-cl: var(--btn-cl-hover);
|
|
263
|
+
background-color: var(--btn-bg, var(--btn, lightgray));
|
|
264
|
+
filter: invert(1) hue-rotate 180deg;
|
|
265
|
+
transform: scale(0.95);
|
|
266
|
+
outline-offset: var(--line-offset, 5px);
|
|
267
|
+
}
|
|
268
|
+
button:is(:hover, :focus)[aria-disabled='true'] {
|
|
269
|
+
transform: none;
|
|
270
|
+
opacity: var(--btn-opacity, 0.5);
|
|
271
|
+
}
|
|
272
|
+
button[type='reset'] {
|
|
273
|
+
--btn-bg: transparent;
|
|
274
|
+
--btn-color: gray;
|
|
275
|
+
--btn-bdr: gray thin solid;
|
|
276
|
+
}
|
|
277
|
+
button[type='submit'] {
|
|
278
|
+
--btn-bg: var(--primary-700, blue);
|
|
279
|
+
--btn-cl: #fff;
|
|
280
|
+
--btn-color: rgb(231, 231, 231);
|
|
281
|
+
--btn-border: none;
|
|
282
|
+
}
|
|
283
|
+
button[data-fp-btn~='pill'],
|
|
284
|
+
button[data-btn~='pill'],
|
|
285
|
+
button[data-style~='pill'] {
|
|
286
|
+
border-radius: var(--btn-pill, 100rem);
|
|
287
|
+
}
|
|
288
|
+
button[data-btn~='sm'] {
|
|
289
|
+
--btn-fs: var(--btn-sm);
|
|
290
|
+
}
|
|
291
|
+
button[data-btn~='md'] {
|
|
292
|
+
--btn-fs: var(--btn-md);
|
|
293
|
+
}
|
|
294
|
+
button[data-btn~='lg'] {
|
|
295
|
+
--btn-fs: var(--btn-lg);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
p[role='note'],
|
|
299
|
+
[role='note'],
|
|
300
|
+
[data-badge] {
|
|
301
|
+
--beta: var(--warning-500, orange);
|
|
302
|
+
--stable: var(--success-500, green);
|
|
303
|
+
--production: rgb(44, 71, 151);
|
|
304
|
+
--badge-px: 0.7rem;
|
|
305
|
+
--badge-py: 0.2rem;
|
|
306
|
+
--badge-fs: 0.8rem;
|
|
307
|
+
--badge-radius: 99rem;
|
|
308
|
+
--badge-bg: lightgray;
|
|
309
|
+
--badge-fw: 500;
|
|
310
|
+
--badge-color: currentColor;
|
|
311
|
+
--badge-display: inline-block;
|
|
312
|
+
display: var(--badge-display);
|
|
313
|
+
padding-inline: var(--badge-px);
|
|
314
|
+
padding-block: var(--badge-py);
|
|
315
|
+
color: var(--badge-color);
|
|
316
|
+
background-color: var(--badge-bg);
|
|
317
|
+
border-radius: var(--badge-radius);
|
|
318
|
+
}
|
|
319
|
+
p[role='note'][data-badge~='beta'],
|
|
320
|
+
[role='note'][data-badge~='beta'],
|
|
321
|
+
[data-badge][data-badge~='beta'] {
|
|
322
|
+
background-color: var(--beta);
|
|
323
|
+
}
|
|
324
|
+
p[role='note'][data-badge~='stable'],
|
|
325
|
+
[role='note'][data-badge~='stable'],
|
|
326
|
+
[data-badge][data-badge~='stable'] {
|
|
327
|
+
--badge-cl: white;
|
|
328
|
+
--badge-bg: var(--stable);
|
|
329
|
+
}
|
|
330
|
+
p[role='note'][data-badge~='production'],
|
|
331
|
+
[role='note'][data-badge~='production'],
|
|
332
|
+
[data-badge][data-badge~='production'] {
|
|
333
|
+
--badge-color: white;
|
|
334
|
+
--badge-bg: var(--production);
|
|
335
|
+
}
|
|
336
|
+
p[role='note'][data-badge~='beta'],
|
|
337
|
+
[role='note'][data-badge~='beta'],
|
|
338
|
+
[data-badge][data-badge~='beta'] {
|
|
339
|
+
--badge-color: currentColor;
|
|
340
|
+
--badge-bg: var(--beta);
|
|
341
|
+
}
|
|
342
|
+
p[role='note'][data-badge~='alpha'],
|
|
343
|
+
[role='note'][data-badge~='alpha'],
|
|
344
|
+
[data-badge][data-badge~='alpha'] {
|
|
345
|
+
--badge-color: currentColor;
|
|
346
|
+
--badge-bg: var(--beta);
|
|
347
|
+
}
|
|
348
|
+
p[role='note'][data-badge~='beta'],
|
|
349
|
+
[role='note'][data-badge~='beta'],
|
|
350
|
+
[data-badge][data-badge~='beta'] {
|
|
351
|
+
--badge-color: currentColor;
|
|
352
|
+
--badge-bg: var(--beta);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
p[role='note'] {
|
|
356
|
+
--badge-display: block;
|
|
357
|
+
--border-radius: 0.5rem;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
[data-card],
|
|
361
|
+
[data-component~='card'] {
|
|
362
|
+
--card-p: 2rem;
|
|
363
|
+
--card-bg: #fff;
|
|
364
|
+
--card-radius: calc(var(--card-p) / 3);
|
|
365
|
+
--card-shadow: 0 0 1rem rgba(0, 0, 0, 0.1);
|
|
366
|
+
--card-position: relative;
|
|
367
|
+
--card-display: flex;
|
|
368
|
+
--card-direction: column;
|
|
369
|
+
--card-gap: 1rem;
|
|
370
|
+
position: relative;
|
|
371
|
+
display: var(--card-display);
|
|
372
|
+
padding: var(--card-p);
|
|
373
|
+
display: var(--card-display);
|
|
374
|
+
flex-direction: var(--card-direction);
|
|
375
|
+
gap: var(--card-gap);
|
|
376
|
+
box-shadow: var(--card-shadow);
|
|
377
|
+
border-radius: var(--card-radius);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
details {
|
|
381
|
+
--details-display: 'flex';
|
|
382
|
+
--details-flex-direction: 'column';
|
|
383
|
+
--details-align-items: 'flex-start';
|
|
384
|
+
--details-margin: '0';
|
|
385
|
+
--details-width: '100%';
|
|
386
|
+
--details-padding-x: '0';
|
|
387
|
+
--details-padding-y: '1.5rem';
|
|
388
|
+
display: var(--details-display);
|
|
389
|
+
flex-direction: var(--details-flex-direction);
|
|
390
|
+
align-items: var(--details-align-items);
|
|
391
|
+
margin: var(--details-margin);
|
|
392
|
+
width: var(--details-width);
|
|
393
|
+
padding-inline: var(--details-padding-x);
|
|
394
|
+
padding-block: var(--details-padding-y);
|
|
395
|
+
}
|
|
396
|
+
details > summary {
|
|
397
|
+
width: var(--details-width);
|
|
398
|
+
display: var(--details-display);
|
|
399
|
+
}
|
|
400
|
+
details > div {
|
|
401
|
+
padding: var(--details-padding-y);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
progress {
|
|
405
|
+
/* Revert all styles */
|
|
406
|
+
all: revert;
|
|
407
|
+
--progress-w: 100%;
|
|
408
|
+
--progress-h: 1rem;
|
|
409
|
+
--progress-bg: #cccccc;
|
|
410
|
+
--progress-color: rgb(71, 71, 245);
|
|
411
|
+
--progress-accent-color: var(--progress-color);
|
|
412
|
+
/* This code changes the color of the progress bar. */
|
|
413
|
+
/* The variable names indicate the colors that are used. */
|
|
414
|
+
/* The colors are used in the progress bar. */
|
|
415
|
+
/* If the progress element is busy, remove the revert styles */
|
|
416
|
+
}
|
|
417
|
+
progress[value] {
|
|
418
|
+
width: var(--progress-w);
|
|
419
|
+
height: var(--progress-h);
|
|
420
|
+
background-color: var(--progress-bg);
|
|
421
|
+
accent-color: var(--progress-accent-color);
|
|
422
|
+
/* Styling for the remaining part of the& bar */
|
|
423
|
+
}
|
|
424
|
+
progress[value]::-webkit-progress-value {
|
|
425
|
+
/* Color for Chrome, Safari, and newer Opera */
|
|
426
|
+
background-color: var(--progress-accent-color);
|
|
427
|
+
accent-color: var(--progress-accent-color);
|
|
428
|
+
}
|
|
429
|
+
progress[value]::-moz-progress-bar {
|
|
430
|
+
/* Color for Firefox */
|
|
431
|
+
background-color: var(--progress-accent-color);
|
|
432
|
+
accent-color: var(--progress-accent-color);
|
|
433
|
+
}
|
|
434
|
+
progress[value]::-webkit-progress-bar {
|
|
435
|
+
/* Background for Chrome, Safari, and newer Opera */
|
|
436
|
+
background-color: var(--progress-background-color);
|
|
437
|
+
accent-color: var(--progress-accent-color);
|
|
438
|
+
}
|
|
439
|
+
progress[aria-busy] {
|
|
440
|
+
width: var(--progress-w);
|
|
441
|
+
height: var(--progress-h);
|
|
442
|
+
accent-color: var(--progress-accent-color);
|
|
443
|
+
/* Styling for the remaining part of the& bar */
|
|
444
|
+
}
|
|
445
|
+
progress[aria-busy]::-webkit-progress-value {
|
|
446
|
+
/* Color for Chrome, Safari, and newer Opera */
|
|
447
|
+
accent-color: var(--progress-accent-color);
|
|
448
|
+
}
|
|
449
|
+
progress[aria-busy]::-moz-progress-bar {
|
|
450
|
+
accent-color: var(--progress-accent-color);
|
|
451
|
+
}
|
|
452
|
+
progress[aria-busy]::-webkit-progress-bar {
|
|
453
|
+
/* Background for Chrome, Safari, and newer Opera */
|
|
454
|
+
accent-color: var(--progress-accent-color);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
details {
|
|
458
|
+
--details-w: 100%;
|
|
459
|
+
--details-h: fit-content;
|
|
460
|
+
--details-border: 1px solid #dfdfdf;
|
|
461
|
+
--details-display: flex;
|
|
462
|
+
--details-justify: flex-start;
|
|
463
|
+
--details-direction: columns;
|
|
464
|
+
--details-gap: 5rem;
|
|
465
|
+
--details-px: 2rem;
|
|
466
|
+
--details-py: 1.5rem;
|
|
467
|
+
--details-radius: 0.5rem;
|
|
468
|
+
--summary-cursor: pointer;
|
|
469
|
+
--summary-transitions: all 0.75s ease-in-out;
|
|
470
|
+
--summary-display: flex;
|
|
471
|
+
--summary-justify: flex-start;
|
|
472
|
+
--summary-align: center;
|
|
473
|
+
--summary-gap: 0.5rem;
|
|
474
|
+
--max-h-closed: 200px;
|
|
475
|
+
--max-h-open: 50rem;
|
|
476
|
+
display: var(--details-display);
|
|
477
|
+
flex-direction: var(--details-direction);
|
|
478
|
+
justify-content: var(--details-justify);
|
|
479
|
+
gap: var(--details-gap);
|
|
480
|
+
width: var(--details-w);
|
|
481
|
+
border: var(--details-border);
|
|
482
|
+
transition: var(--summary-transitions);
|
|
483
|
+
max-height: var(--max-h-closed);
|
|
484
|
+
overflow: clip;
|
|
485
|
+
border-radius: var(--details-radius);
|
|
486
|
+
}
|
|
487
|
+
details::marker {
|
|
488
|
+
content: none;
|
|
489
|
+
}
|
|
490
|
+
details summary {
|
|
491
|
+
display: var(--summary-display);
|
|
492
|
+
justify-content: var(--summary-justify);
|
|
493
|
+
align-items: var(--summary-align);
|
|
494
|
+
padding-inline: var(--summary-px, var(--details-px));
|
|
495
|
+
padding-block: var(--summary-py, var(--details-py));
|
|
496
|
+
gap: var(--summary-gap);
|
|
497
|
+
}
|
|
498
|
+
details summary:hover {
|
|
499
|
+
cursor: var(--summary-cursor);
|
|
500
|
+
}
|
|
501
|
+
details summary > section {
|
|
502
|
+
width: var(--details-w);
|
|
503
|
+
}
|
|
504
|
+
details > section {
|
|
505
|
+
padding-inline: var(--details-px);
|
|
506
|
+
padding-block: var(--details-py);
|
|
507
|
+
border: 1px transparent solid;
|
|
508
|
+
}
|
|
509
|
+
details[open] {
|
|
510
|
+
max-height: var(--max-h-open);
|
|
511
|
+
transition: var(--summary-transitions);
|
|
512
|
+
}
|
|
513
|
+
details[open] > summary {
|
|
514
|
+
border-bottom: var(--details-border);
|
|
515
|
+
}
|
|
516
|
+
details[open] > section {
|
|
517
|
+
max-height: var(--max-h-open);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/*# sourceMappingURL=index.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../sass/_reset.scss","../../sass/_globals.scss","../buttons/button.scss","../badge/badge.scss","../cards/card.scss","../dropdowns/dropdown.scss","../progress/progress.scss","../details/details.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;EAGE;;;AAGF;AACE;AACA;EACA;AAEA;AACA;EACA;EACA;;;AAGF;AAAA;AAAA;AAGA;AAAA;EAEE;EACA;;;AAGF;AACA;EACE;;;AAGF;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAUE;;;AAGF;AAGE;AAAA;EACE;EACA;EACA;EACA;;;AAIJ;AACA;EACE;EACA;EACA;;;AAGF;AACA;EACE;;;AAGF;AAAA;EAEE;;;AAGF;AACA;AAAA;AAAA;AAAA;EAIE;EACA;EACA;;;AAGF;AAAA;AAAA;EAGE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;AACA;AAAA;AAAA;EAGE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;AACA;EACE;;;AAGF;AACA;EACE;IACE;;EAGF;AAAA;AAAA;IAGE;IACA;IACA;IACA;;;AAIJ;AACA;AAAA;EAEE;;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAOE;;;AAGF;EACE;;;AAGF;AACA;EACE;;;AAGF;EACE;AAEA;AAGA;EACA;;AAEA;EACE;EACA;EACA;;;AC/KJ;EACE;AAAA;AAAA;EAGA;;;AAGF;EACE;EACA;;;AAGF;AAAA;AAAA;EAGE;;AACA;AAAA;AAAA;EACE;EACA;;AAEF;AAAA;AAAA;EACE;;;AAIJ;EACE;EACA;;;AAGF;EACE;;AACA;EACE;;;ACjCJ;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EAEE;EACA;;AAGF;EAEE;EACA;;AAEA;EACE;EAEA;;AAKJ;EAEE;EACA;EACA;EACA;EAEA;;AAEA;EACE;EACA;;AAIJ;EACE;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EAGE;;AAGF;EACE;;AAGF;EACE;;AAGF;EACE;;;AClGJ;AAAA;AAAA;EAGE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;EACE;EACA;;AAGF;AAAA;AAAA;EACE;EACA;;AAGF;AAAA;AAAA;EACE;EACA;;AAGF;AAAA;AAAA;EACE;EACA;;AAEF;AAAA;AAAA;EACE;EACA;;;AAGJ;EACE;EACA;;;ACpDF;AAAA;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;AClBF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAGF;EACE;;;ACvBJ;AACE;EACA;EACA;EACA;EACA;EACA;EACA;AAEA;AACA;AACA;AA8BA;;AA7BA;EAEE;EACA;EACA;EACA;AAgBA;;AAbA;AACE;EACA;EACA;;AAIF;AACE;EACA;EACA;;AAIF;AACE;EACA;EACA;;AAKJ;EAEE;EACA;EAEA;AAcA;;AAZA;AACE;EAEA;;AAGF;EAGE;;AAIF;AACE;EAEA;;;ACjEN;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAEF;EACE;;AAIJ;EACE;EACA;EACA;;AAGF;EACE;EACA;;AACA;EACE;;AAEF;EACE","file":"index.css"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import FP from '../fp'
|
|
2
|
+
import { ComponentProps } from '../../types'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export const Caption = ({ children, ...props }: ComponentProps) => {
|
|
7
|
+
return (
|
|
8
|
+
<FP as="caption" {...props}>
|
|
9
|
+
{children}
|
|
10
|
+
</FP>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const Thead = ({ children, ...props }: ComponentProps) => (
|
|
15
|
+
<FP as="thead" {...props}>
|
|
16
|
+
{children}
|
|
17
|
+
</FP>
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
export const Tbody = ({ children, ...props }: ComponentProps) => (
|
|
21
|
+
<FP as="tbody" {...props}>
|
|
22
|
+
{children}
|
|
23
|
+
</FP>
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
export const Tr = ({ children, ...props }: ComponentProps) => (
|
|
27
|
+
<FP as="tr" {...props}>
|
|
28
|
+
{children}
|
|
29
|
+
</FP>
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
export const Td = ({ children, ...props }: ComponentProps) => (
|
|
33
|
+
<FP as="td" {...props}>
|
|
34
|
+
{children}
|
|
35
|
+
</FP>
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
export const Table = ({ id, dataStyle, children, ...props }: ComponentProps) => {
|
|
39
|
+
return (
|
|
40
|
+
<FP
|
|
41
|
+
as="section"
|
|
42
|
+
id={id}
|
|
43
|
+
{...props}
|
|
44
|
+
data-style="table-wrapper"
|
|
45
|
+
>
|
|
46
|
+
<table>{children}</table>
|
|
47
|
+
</FP>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
Table.displayName = 'Table'
|
|
52
|
+
Caption.displayName = 'Caption'
|
|
53
|
+
Thead.displayName = 'Thead'
|
|
54
|
+
Tbody.displayName = 'Tbody'
|
|
55
|
+
Tr.displayName = 'Tr'
|
|
56
|
+
Td.displayName = 'Td'
|
|
57
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Table, Caption, Thead, Tbody, Td, Tr } from './table-elements'
|
|
2
|
+
import { ComponentProps } from '../../types'
|
|
3
|
+
|
|
4
|
+
import React from 'react'
|
|
5
|
+
|
|
6
|
+
export interface TableProps extends ComponentProps {
|
|
7
|
+
tblHead: React.ReactNode
|
|
8
|
+
tblBody: React.ReactNode
|
|
9
|
+
tblCaption?: React.ReactNode
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type dataType = { id: number; items: string[] }[]
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Render the `thead` by passing an array of names
|
|
16
|
+
*/
|
|
17
|
+
export const RenderHead = (data: []) => {
|
|
18
|
+
const head = data.map((item, index) => {
|
|
19
|
+
return <th key={index}>{item}</th>
|
|
20
|
+
})
|
|
21
|
+
return <tr>{head}</tr>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Render the table body `tr`, `td` with the data provided
|
|
26
|
+
*/
|
|
27
|
+
export const RenderBody = (data: {}[]) => {
|
|
28
|
+
const rec = data.map((item, index) => {
|
|
29
|
+
return (
|
|
30
|
+
<tr key={index}>
|
|
31
|
+
{/* <td>{item?.id}</td>
|
|
32
|
+
<td>{item?.items}</td> */}
|
|
33
|
+
</tr>
|
|
34
|
+
)
|
|
35
|
+
})
|
|
36
|
+
return <Tbody>{rec}</Tbody>
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Render the table placing `caption`, `thead` and `tbody` in the correct order
|
|
41
|
+
* caption is optional
|
|
42
|
+
*/
|
|
43
|
+
export const RenderTable = ({ tblBody, tblCaption, tblHead }: TableProps) => {
|
|
44
|
+
return (
|
|
45
|
+
<Table>
|
|
46
|
+
{tblCaption && <Caption>{tblCaption}</Caption>}
|
|
47
|
+
<Thead>
|
|
48
|
+
<Tr>{tblHead}</Tr>
|
|
49
|
+
</Thead>
|
|
50
|
+
<Tbody>{tblBody}</Tbody>
|
|
51
|
+
</Table>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
RenderTable.displayName = 'TBL'
|
|
56
|
+
RenderBody.displayName = 'renderBody'
|
|
57
|
+
RenderHead.displayName = 'renderHead'
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
p[role='note'],
|
|
2
|
+
[role='note'],
|
|
3
|
+
small > span,
|
|
4
|
+
[data-tag] {
|
|
5
|
+
--beta: var(--warning-500, orange);
|
|
6
|
+
--stable: var(--success-500, green);
|
|
7
|
+
--production: rgb(44, 71, 151);
|
|
8
|
+
--tag-px: 0.7rem;
|
|
9
|
+
--tag-py: 0.2rem;
|
|
10
|
+
--tag-fs: 0.8rem;
|
|
11
|
+
--tag-radius: 99rem;
|
|
12
|
+
--tag-bg: lightgray;
|
|
13
|
+
--tag-fw: 500;
|
|
14
|
+
--tag-color: currentColor;
|
|
15
|
+
--tag-display: inline-block;
|
|
16
|
+
|
|
17
|
+
display: var(--tag-display);
|
|
18
|
+
padding-inline: var(--tag-px);
|
|
19
|
+
padding-block: var(--tag-py);
|
|
20
|
+
font-size: var(--tag-fs);
|
|
21
|
+
color: var(--tag-color);
|
|
22
|
+
background-color: var(--tag-bg);
|
|
23
|
+
border-radius: var(--tag-radius);
|
|
24
|
+
|
|
25
|
+
&[data-tag~='beta'] {
|
|
26
|
+
background-color: var(--beta);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&[data-tag~='stable'] {
|
|
30
|
+
--tag-cl: white;
|
|
31
|
+
--tag-bg: var(--stable);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&[data-tag~='production'] {
|
|
35
|
+
--tag-color: white;
|
|
36
|
+
--tag-bg: var(--production);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&[data-tag~='beta'] {
|
|
40
|
+
--tag-color: currentColor;
|
|
41
|
+
--tag-bg: var(--beta);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&[data-tag~='alpha'] {
|
|
45
|
+
--tag-color: currentColor;
|
|
46
|
+
--tag-bg: var(--beta);
|
|
47
|
+
}
|
|
48
|
+
&[data-tag~='beta'] {
|
|
49
|
+
--tag-color: currentColor;
|
|
50
|
+
--tag-bg: var(--beta);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
p[role='note'] {
|
|
54
|
+
--tag-display: block;
|
|
55
|
+
--border-radius: 0.5rem;
|
|
56
|
+
}
|