@fpkit/acss 0.6.2 → 1.0.0-beta.1
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/libs/components/alert/alert.css +1 -1
- package/libs/components/alert/alert.css.map +1 -1
- package/libs/components/alert/alert.min.css +2 -2
- package/libs/components/badge/badge.css +1 -1
- package/libs/components/badge/badge.css.map +1 -1
- package/libs/components/badge/badge.min.css +2 -2
- package/libs/components/breadcrumbs/breadcrumb.css +1 -1
- package/libs/components/breadcrumbs/breadcrumb.css.map +1 -1
- package/libs/components/breadcrumbs/breadcrumb.min.css +2 -2
- package/libs/components/buttons/button.css +1 -1
- package/libs/components/buttons/button.css.map +1 -1
- package/libs/components/buttons/button.min.css +2 -2
- package/libs/components/cards/card.css +1 -1
- package/libs/components/cards/card.css.map +1 -1
- package/libs/components/cards/card.min.css +2 -2
- package/libs/components/details/details.css +1 -1
- package/libs/components/details/details.css.map +1 -1
- package/libs/components/details/details.min.css +2 -2
- package/libs/components/dialog/dialog.css +1 -1
- package/libs/components/dialog/dialog.css.map +1 -1
- package/libs/components/dialog/dialog.min.css +2 -2
- package/libs/components/form/form.css +1 -1
- package/libs/components/form/form.css.map +1 -1
- package/libs/components/form/form.min.css +2 -2
- package/libs/components/icons/icon.d.cts +32 -32
- package/libs/components/icons/icon.d.ts +32 -32
- package/libs/components/images/img.css +1 -1
- package/libs/components/images/img.css.map +1 -1
- package/libs/components/images/img.min.css +2 -2
- package/libs/components/layout/landmarks.css +1 -1
- package/libs/components/layout/landmarks.css.map +1 -1
- package/libs/components/layout/landmarks.min.css +2 -2
- package/libs/components/link/link.css +1 -1
- package/libs/components/link/link.css.map +1 -1
- package/libs/components/link/link.min.css +2 -2
- package/libs/components/nav/nav.css +1 -1
- package/libs/components/nav/nav.css.map +1 -1
- package/libs/components/nav/nav.min.css +2 -2
- package/libs/components/progress/progress.css +1 -1
- package/libs/components/progress/progress.css.map +1 -1
- package/libs/components/progress/progress.min.css +2 -2
- package/libs/components/tag/tag.css +1 -1
- package/libs/components/tag/tag.css.map +1 -1
- package/libs/components/tag/tag.min.css +2 -2
- package/libs/index.css +1 -1
- package/libs/index.css.map +1 -1
- package/package.json +1 -1
- package/src/components/alert/alert.scss +4 -4
- package/src/components/alert/alert.scss.backup +184 -0
- package/src/components/alert/alert.stories.tsx +53 -2
- package/src/components/badge/badge.scss +2 -2
- package/src/components/badge/badge.scss.backup +39 -0
- package/src/components/badge/badge.stories.tsx +40 -0
- package/src/components/breadcrumbs/breadcrumb.scss +5 -5
- package/src/components/breadcrumbs/breadcrumb.scss.backup +35 -0
- package/src/components/breadcrumbs/breadcrumb.stories.tsx +17 -1
- package/src/components/buttons/button.scss +27 -27
- package/src/components/buttons/button.scss.backup +145 -0
- package/src/components/buttons/button.stories.tsx +188 -2
- package/src/components/cards/card.scss +39 -5
- package/src/components/cards/card.scss.backup +67 -0
- package/src/components/cards/card.stories.tsx +183 -0
- package/src/components/details/details.scss +14 -14
- package/src/components/details/details.scss.backup +126 -0
- package/src/components/details/details.stories.tsx +40 -0
- package/src/components/dialog/dialog.scss +3 -3
- package/src/components/dialog/dialog.scss.backup +126 -0
- package/src/components/form/form.scss +25 -9
- package/src/components/form/form.scss.backup +87 -0
- package/src/components/form/form.stories.tsx +271 -0
- package/src/components/form/input.stories.tsx +158 -0
- package/src/components/images/figure.stories.tsx +41 -1
- package/src/components/images/img.scss +8 -8
- package/src/components/images/img.scss.backup +59 -0
- package/src/components/layout/_header.scss +14 -14
- package/src/components/layout/_header.scss.backup +72 -0
- package/src/components/layout/landmarks.scss +7 -7
- package/src/components/layout/landmarks.scss.backup +51 -0
- package/src/components/layout/landmarks.stories.tsx +42 -0
- package/src/components/link/link.scss +5 -5
- package/src/components/link/link.scss.backup +145 -0
- package/src/components/link/link.stories.tsx +38 -2
- package/src/components/nav/nav.scss +17 -17
- package/src/components/nav/nav.scss.backup +123 -0
- package/src/components/nav/nav.stories.tsx +35 -1
- package/src/components/progress/progress.scss +7 -7
- package/src/components/progress/progress.scss.backup +70 -0
- package/src/components/tag/tag.scss +10 -10
- package/src/components/tag/tag.scss.backup +130 -0
- package/src/components/tag/tag.stories.tsx +23 -2
- package/src/styles/alert/alert.css +4 -4
- package/src/styles/badge/badge.css +2 -2
- package/src/styles/breadcrumbs/breadcrumb.css +5 -5
- package/src/styles/buttons/button.css +26 -27
- package/src/styles/buttons/button.css.map +1 -1
- package/src/styles/cards/card.css +35 -5
- package/src/styles/cards/card.css.map +1 -1
- package/src/styles/details/details.css +14 -14
- package/src/styles/dialog/dialog.css +3 -3
- package/src/styles/form/form.css +20 -10
- package/src/styles/form/form.css.map +1 -1
- package/src/styles/images/img.css +8 -8
- package/src/styles/index.css +170 -131
- package/src/styles/index.css.map +1 -1
- package/src/styles/layout/landmarks.css +21 -21
- package/src/styles/link/link.css +5 -5
- package/src/styles/nav/nav.css +17 -17
- package/src/styles/progress/progress.css +6 -6
- package/src/styles/tag/tag.css +4 -4
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
details {
|
|
2
|
+
--details-border: 0.0625rem solid #dfdfdf;
|
|
3
|
+
--details-direction: column;
|
|
4
|
+
--details-display: flex;
|
|
5
|
+
--details-gap: 0rem;
|
|
6
|
+
--details-h: max-content;
|
|
7
|
+
--details-justify: flex-start;
|
|
8
|
+
--details-px: 1.5rem;
|
|
9
|
+
--details-py: 1rem;
|
|
10
|
+
--details-radius: 0;
|
|
11
|
+
--details-w: 100%;
|
|
12
|
+
--max-h-closed: 6.25rem;
|
|
13
|
+
--max-h-open: 50rem;
|
|
14
|
+
--summary-align: center;
|
|
15
|
+
--summary-cursor: pointer;
|
|
16
|
+
--summary-display: flex;
|
|
17
|
+
--summary-gap: 0.5rem;
|
|
18
|
+
--summary-justify: flex-start;
|
|
19
|
+
--summary-transitions: all 0.75s ease-in-out;
|
|
20
|
+
|
|
21
|
+
interpolate-size: allow-keywords;
|
|
22
|
+
display: var(--details-display);
|
|
23
|
+
flex-direction: var(--details-direction);
|
|
24
|
+
justify-content: var(--details-justify);
|
|
25
|
+
gap: var(--details-gap);
|
|
26
|
+
width: var(--details-w);
|
|
27
|
+
border: var(--details-border);
|
|
28
|
+
border-left: none;
|
|
29
|
+
border-right: none;
|
|
30
|
+
transition: var(--summary-transitions);
|
|
31
|
+
max-height: var(--max-h-closed);
|
|
32
|
+
overflow: clip;
|
|
33
|
+
|
|
34
|
+
@starting-style {
|
|
35
|
+
transition: var(--summary-transitions);
|
|
36
|
+
color: red;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
& + details {
|
|
40
|
+
border-radius: 0; // remove radius from middle elements
|
|
41
|
+
border-top: none; // optional: remove double borders
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:first-of-type {
|
|
45
|
+
border-radius: var(--details-radius) var(--details-radius) 0 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:last-of-type {
|
|
49
|
+
border-radius: 0 0 var(--details-radius) var(--details-radius);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// If it's the only details element, keep original radius
|
|
53
|
+
&:only-of-type {
|
|
54
|
+
border-radius: var(--details-radius);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&::marker {
|
|
58
|
+
content: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
summary {
|
|
62
|
+
display: var(--summary-display);
|
|
63
|
+
justify-content: var(--summary-justify);
|
|
64
|
+
align-items: var(--summary-align);
|
|
65
|
+
padding-inline: var(--summary-px, var(--details-px));
|
|
66
|
+
padding-block: var(--summary-py, var(--details-py));
|
|
67
|
+
gap: var(--summary-gap);
|
|
68
|
+
list-style: none;
|
|
69
|
+
border-top-left-radius: var(--details-radius);
|
|
70
|
+
border-top-right-radius: var(--details-radius);
|
|
71
|
+
transition: var(--summary-transitions);
|
|
72
|
+
|
|
73
|
+
&::-webkit-details-marker {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&:focus-within {
|
|
78
|
+
outline: none;
|
|
79
|
+
border-bottom: solid 2px currentColor;
|
|
80
|
+
background-color: whitesmoke;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* This ensures no bullet points are shown */
|
|
84
|
+
&:hover {
|
|
85
|
+
cursor: var(--summary-cursor);
|
|
86
|
+
}
|
|
87
|
+
> section {
|
|
88
|
+
width: var(--details-w);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.list-styles {
|
|
93
|
+
summary {
|
|
94
|
+
border-left: none;
|
|
95
|
+
border-right: none;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
> section {
|
|
100
|
+
padding-inline: var(--details-px);
|
|
101
|
+
padding-block: var(--details-py);
|
|
102
|
+
margin-block-start: 0;
|
|
103
|
+
border: 1px transparent solid;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&[open] {
|
|
107
|
+
max-height: max-content;
|
|
108
|
+
transition: var(--summary-transitions);
|
|
109
|
+
> summary {
|
|
110
|
+
border-bottom: var(--details-border);
|
|
111
|
+
}
|
|
112
|
+
> section {
|
|
113
|
+
max-height: var(--max-h-open);
|
|
114
|
+
@starting-style {
|
|
115
|
+
max-height: 0;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@supports (transition-behavior: allow-discrete) {
|
|
121
|
+
@starting-style {
|
|
122
|
+
max-height: 0;
|
|
123
|
+
transition: var(--summary-transitions);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -32,6 +32,46 @@ const meta: Meta<typeof Details> = {
|
|
|
32
32
|
title: "FP.REACT Components/Details",
|
|
33
33
|
component: Details,
|
|
34
34
|
tags: ["rc"],
|
|
35
|
+
parameters: {
|
|
36
|
+
docs: {
|
|
37
|
+
description: {
|
|
38
|
+
component: `Expandable/collapsible details component with smooth transitions and accessible markup.
|
|
39
|
+
|
|
40
|
+
## CSS Variables
|
|
41
|
+
|
|
42
|
+
### Layout & Display
|
|
43
|
+
- \`--details-display\`: Display mode (default: flex)
|
|
44
|
+
- \`--details-direction\`: Flex direction (default: column)
|
|
45
|
+
- \`--details-justify\`: Content justification (default: flex-start)
|
|
46
|
+
- \`--details-width\`: Details width (default: 100%)
|
|
47
|
+
- \`--details-height\`: Details height (default: max-content)
|
|
48
|
+
- \`--details-gap\`: Gap between elements (default: 0rem)
|
|
49
|
+
|
|
50
|
+
### Sizing & Constraints
|
|
51
|
+
- \`--details-max-height-closed\`: Max height when closed (default: 6.25rem)
|
|
52
|
+
- \`--details-max-height-open\`: Max height when open (default: 50rem)
|
|
53
|
+
|
|
54
|
+
### Spacing
|
|
55
|
+
- \`--details-padding-inline\`: Horizontal padding (default: 1.5rem)
|
|
56
|
+
- \`--details-padding-block\`: Vertical padding (default: 1rem)
|
|
57
|
+
|
|
58
|
+
### Borders & Radius
|
|
59
|
+
- \`--details-border\`: Border style (default: 0.0625rem solid #dfdfdf)
|
|
60
|
+
- \`--details-radius\`: Border radius (default: 0)
|
|
61
|
+
|
|
62
|
+
### Summary Element
|
|
63
|
+
- \`--summary-display\`: Summary display mode (default: flex)
|
|
64
|
+
- \`--summary-justify\`: Summary content justification (default: flex-start)
|
|
65
|
+
- \`--summary-align\`: Summary vertical alignment (default: center)
|
|
66
|
+
- \`--summary-gap\`: Gap within summary (default: 0.5rem)
|
|
67
|
+
- \`--summary-padding-inline\`: Summary horizontal padding (fallback: \`--details-padding-inline\`)
|
|
68
|
+
- \`--summary-padding-block\`: Summary vertical padding (fallback: \`--details-padding-block\`)
|
|
69
|
+
- \`--summary-cursor\`: Summary cursor style (default: pointer)
|
|
70
|
+
- \`--summary-transitions\`: Transition timing (default: all 0.75s ease-in-out)
|
|
71
|
+
`,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
35
75
|
args: {
|
|
36
76
|
children: content,
|
|
37
77
|
icon: icon,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--dialog-min-
|
|
2
|
+
--dialog-min-width: max(20rem, 80%);
|
|
3
3
|
--dialog-gap: 0.625rem;
|
|
4
4
|
--dialog-border-color: lightgray;
|
|
5
5
|
--dialog-border-width: thin;
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
dialog {
|
|
36
|
-
width: var(--dialog-min-
|
|
37
|
-
min-width: var(--min-
|
|
36
|
+
width: var(--dialog-min-width);
|
|
37
|
+
min-width: var(--dialog-min-width);
|
|
38
38
|
gap: var(--dialog-gap);
|
|
39
39
|
border: var(--dialog-border-color) var(--dialog-border-width) solid;
|
|
40
40
|
border-radius: var(--dialog-border-radius);
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--dialog-min-w: max(20rem, 80%);
|
|
3
|
+
--dialog-gap: 0.625rem;
|
|
4
|
+
--dialog-border-color: lightgray;
|
|
5
|
+
--dialog-border-width: thin;
|
|
6
|
+
--dialog-border-style: solid;
|
|
7
|
+
--dialog-border-radius: var(--border-radius);
|
|
8
|
+
--dialog-padding: 1.5rem;
|
|
9
|
+
--dialog-padding-inline: 1rem;
|
|
10
|
+
--dialog-close-color: gray;
|
|
11
|
+
--dialog-button-bg: transparent;
|
|
12
|
+
--dialog-button-border: transparent thin solid;
|
|
13
|
+
--dialog-button-hover-bg: whitesmoke;
|
|
14
|
+
--dialog-display: flex;
|
|
15
|
+
--dialog-flex-direction: column;
|
|
16
|
+
|
|
17
|
+
/* Focus and accessibility */
|
|
18
|
+
--dialog-focus-color: #0066cc;
|
|
19
|
+
--dialog-focus-width: 0.125rem;
|
|
20
|
+
--dialog-focus-offset: 0.125rem;
|
|
21
|
+
--dialog-focus-outline: var(--dialog-focus-width) solid var(--dialog-focus-color);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* High contrast mode support */
|
|
25
|
+
@media (prefers-contrast: high) {
|
|
26
|
+
:root {
|
|
27
|
+
--dialog-border-color: currentColor;
|
|
28
|
+
--dialog-border-width: 0.125rem;
|
|
29
|
+
--dialog-close-color: currentColor;
|
|
30
|
+
--dialog-button-border: currentColor 0.125rem solid;
|
|
31
|
+
--dialog-focus-width: 0.1875rem;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
dialog {
|
|
36
|
+
width: var(--dialog-min-w);
|
|
37
|
+
min-width: var(--min-w);
|
|
38
|
+
gap: var(--dialog-gap);
|
|
39
|
+
border: var(--dialog-border-color) var(--dialog-border-width) solid;
|
|
40
|
+
border-radius: var(--dialog-border-radius);
|
|
41
|
+
padding: var(--dialog-padding);
|
|
42
|
+
padding-block-start: var(--dialog-padding);
|
|
43
|
+
|
|
44
|
+
/* Focus visible for keyboard navigation */
|
|
45
|
+
&:focus-visible {
|
|
46
|
+
outline: var(--dialog-focus-outline);
|
|
47
|
+
outline-offset: var(--dialog-focus-offset);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&[open] {
|
|
51
|
+
display: var(--dialog-display);
|
|
52
|
+
flex-direction: var(--dialog-flex-direction);
|
|
53
|
+
gap: var(--dialog-gap);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
section {
|
|
57
|
+
width: 100%;
|
|
58
|
+
display: flex;
|
|
59
|
+
justify-content: start;
|
|
60
|
+
gap: var(--dialog-gap);
|
|
61
|
+
flex-direction: var(--dialog-flex-direction);
|
|
62
|
+
margin-block-start: 0;
|
|
63
|
+
--sect-y: 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.dialog-header {
|
|
68
|
+
display: flex;
|
|
69
|
+
justify-content: space-between;
|
|
70
|
+
align-items: center;
|
|
71
|
+
width: 100%;
|
|
72
|
+
min-width: 100%;
|
|
73
|
+
|
|
74
|
+
h3 {
|
|
75
|
+
margin-block-start: 0;
|
|
76
|
+
margin-block-end: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.dialog-close {
|
|
80
|
+
margin-block-end: 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
button[type="button"] {
|
|
84
|
+
background-color: var(--dialog-button-bg);
|
|
85
|
+
border: var(--dialog-button-border);
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
|
|
88
|
+
&:hover {
|
|
89
|
+
border-color: var(--dialog-close-color);
|
|
90
|
+
background-color: var(--dialog-button-hover-bg);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Keyboard focus indicator */
|
|
94
|
+
&:focus-visible {
|
|
95
|
+
outline: var(--dialog-focus-outline);
|
|
96
|
+
outline-offset: var(--dialog-focus-offset);
|
|
97
|
+
border-color: var(--dialog-focus-color);
|
|
98
|
+
background-color: var(--dialog-button-hover-bg);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Remove default focus for mouse users */
|
|
102
|
+
&:focus:not(:focus-visible) {
|
|
103
|
+
outline: none;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.alert-dialog-actions,
|
|
109
|
+
.dialog-footer {
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: row;
|
|
112
|
+
flex-wrap: wrap;
|
|
113
|
+
justify-content: var(--dialog-footer-justify, flex-end);
|
|
114
|
+
gap: var(--dialog-gap);
|
|
115
|
+
width: 100%;
|
|
116
|
+
|
|
117
|
+
/* Focus styles for footer buttons */
|
|
118
|
+
button:focus-visible {
|
|
119
|
+
outline: var(--dialog-focus-outline);
|
|
120
|
+
outline-offset: var(--dialog-focus-offset);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
button:focus:not(:focus-visible) {
|
|
124
|
+
outline: none;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -4,14 +4,26 @@
|
|
|
4
4
|
--input-bg: inherit;
|
|
5
5
|
--input-border: none;
|
|
6
6
|
--input-outline: thin solid var(--input-border-color);
|
|
7
|
-
--input-
|
|
8
|
-
--input-
|
|
7
|
+
--input-padding-inline: 0.6rem;
|
|
8
|
+
--input-padding-block: 0.4rem;
|
|
9
9
|
--input-radius: --var(--radius);
|
|
10
10
|
--input-fs: var(--fs);
|
|
11
|
-
--input-
|
|
11
|
+
--input-width: clamp(200px, 100%, 500px);
|
|
12
|
+
|
|
13
|
+
// Focus state variables (NEW - for accessibility)
|
|
14
|
+
--input-focus-outline: medium solid var(--input-border-color);
|
|
15
|
+
--input-focus-outline-offset: 0;
|
|
16
|
+
|
|
17
|
+
// Disabled state variables (NEW)
|
|
18
|
+
--input-disabled-bg: #f5f5f5;
|
|
19
|
+
--input-disabled-opacity: 0.6;
|
|
20
|
+
--input-disabled-cursor: not-allowed;
|
|
21
|
+
|
|
22
|
+
// Placeholder variables
|
|
12
23
|
--placeholder-color: gray;
|
|
13
24
|
--placeholder-style: italic;
|
|
14
25
|
--placeholder-fs: smaller;
|
|
26
|
+
|
|
15
27
|
--form-direction: column;
|
|
16
28
|
--select-arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20'><polyline points='6,9 10,13 14,9' stroke='%23000000' stroke-width='1.5' fill='none' /></svg>");
|
|
17
29
|
}
|
|
@@ -37,11 +49,11 @@ select {
|
|
|
37
49
|
-webkit-appearance: var(--input-appearance);
|
|
38
50
|
-moz-appearance: var(--input-appearance);
|
|
39
51
|
appearance: var(--input-appearance);
|
|
40
|
-
width: var(--input-
|
|
52
|
+
width: var(--input-width);
|
|
41
53
|
border: var(--input-border);
|
|
42
54
|
outline: var(--input-outline);
|
|
43
|
-
padding-inline: var(--input-
|
|
44
|
-
padding-block: var(--input-
|
|
55
|
+
padding-inline: var(--input-padding-inline);
|
|
56
|
+
padding-block: var(--input-padding-block);
|
|
45
57
|
border-radius: var(--input-radius);
|
|
46
58
|
background-color: var(--input-bg, #fff);
|
|
47
59
|
|
|
@@ -53,7 +65,8 @@ select {
|
|
|
53
65
|
}
|
|
54
66
|
|
|
55
67
|
&:focus-visible, &:focus {
|
|
56
|
-
outline
|
|
68
|
+
outline: var(--input-focus-outline);
|
|
69
|
+
outline-offset: var(--input-focus-outline-offset);
|
|
57
70
|
}
|
|
58
71
|
|
|
59
72
|
|
|
@@ -67,9 +80,12 @@ select {
|
|
|
67
80
|
}
|
|
68
81
|
}
|
|
69
82
|
|
|
70
|
-
&[aria-disabled='true']
|
|
83
|
+
&[aria-disabled='true'],
|
|
84
|
+
&:disabled {
|
|
71
85
|
--input-border-color: lightgray;
|
|
72
|
-
|
|
86
|
+
background-color: var(--input-disabled-bg);
|
|
87
|
+
opacity: var(--input-disabled-opacity);
|
|
88
|
+
cursor: var(--input-disabled-cursor);
|
|
73
89
|
text-transform: capitalize;
|
|
74
90
|
text-decoration: line-through;
|
|
75
91
|
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--input-border-color: gray;
|
|
3
|
+
--input-appearance: none;
|
|
4
|
+
--input-bg: inherit;
|
|
5
|
+
--input-border: none;
|
|
6
|
+
--input-outline: thin solid var(--input-border-color);
|
|
7
|
+
--input-px: 0.6rem;
|
|
8
|
+
--input-py: 0.4rem;
|
|
9
|
+
--input-radius: --var(--radius);
|
|
10
|
+
--input-fs: var(--fs);
|
|
11
|
+
--input-w: clamp(200px, 100%, 500px);
|
|
12
|
+
--placeholder-color: gray;
|
|
13
|
+
--placeholder-style: italic;
|
|
14
|
+
--placeholder-fs: smaller;
|
|
15
|
+
--form-direction: column;
|
|
16
|
+
--select-arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20'><polyline points='6,9 10,13 14,9' stroke='%23000000' stroke-width='1.5' fill='none' /></svg>");
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
form {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: var(--form-direction);
|
|
22
|
+
gap: 1rem;
|
|
23
|
+
> div {
|
|
24
|
+
display: flex;
|
|
25
|
+
gap: 1rem;
|
|
26
|
+
flex-direction: var(--form-direction);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
label {
|
|
30
|
+
display: block;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
input[type]:not([type='checkbox'], [type='radio']),
|
|
35
|
+
textarea,
|
|
36
|
+
select {
|
|
37
|
+
-webkit-appearance: var(--input-appearance);
|
|
38
|
+
-moz-appearance: var(--input-appearance);
|
|
39
|
+
appearance: var(--input-appearance);
|
|
40
|
+
width: var(--input-w);
|
|
41
|
+
border: var(--input-border);
|
|
42
|
+
outline: var(--input-outline);
|
|
43
|
+
padding-inline: var(--input-px);
|
|
44
|
+
padding-block: var(--input-py);
|
|
45
|
+
border-radius: var(--input-radius);
|
|
46
|
+
background-color: var(--input-bg, #fff);
|
|
47
|
+
|
|
48
|
+
&::placeholder {
|
|
49
|
+
color: var(--placeholder-color);
|
|
50
|
+
font-style: var(--placeholder-style);
|
|
51
|
+
font-size: var(--placeholder-fs);
|
|
52
|
+
text-transform: capitalize;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:focus-visible, &:focus {
|
|
56
|
+
outline-width: medium;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
&[aria-required='true'] {
|
|
61
|
+
&::placeholder {
|
|
62
|
+
color: var(--color-required, var(--placeholder-color));
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
&::after {
|
|
65
|
+
content: '* ';
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&[aria-disabled='true'] {
|
|
71
|
+
--input-border-color: lightgray;
|
|
72
|
+
cursor: not-allowed;
|
|
73
|
+
text-transform: capitalize;
|
|
74
|
+
text-decoration: line-through;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
select {
|
|
79
|
+
border: var(--input-outline);
|
|
80
|
+
outline: none;
|
|
81
|
+
-webkit-appearance: none; /* Remove default arrow in Chrome and Safari */
|
|
82
|
+
-moz-appearance: none; /* Remove default arrow in Firefox */
|
|
83
|
+
appearance: none; /* Remove default arrow in other browsers */
|
|
84
|
+
background: var(--select-arrow) no-repeat;
|
|
85
|
+
background-position: right 0.5rem top 50%;
|
|
86
|
+
padding-inline-end: 0;
|
|
87
|
+
}
|