@fpkit/acss 6.0.0 → 6.2.0
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/{chunk-DIJBIOFE.js → chunk-2ZJV6KQ3.js} +3 -3
- package/libs/{chunk-LXODKKA3.cjs → chunk-3D6WUYSL.cjs} +4 -4
- package/libs/{chunk-2JCDEC32.js → chunk-3ENBUQIB.js} +3 -3
- package/libs/{chunk-NCGVF2QS.cjs → chunk-3RVZZZWX.cjs} +4 -4
- package/libs/{chunk-M7JLT62Q.js → chunk-4F6SI5V5.js} +2 -2
- package/libs/chunk-4KJP3L35.js +7 -0
- package/libs/chunk-4KJP3L35.js.map +1 -0
- package/libs/chunk-66C2J4IX.cjs +13 -0
- package/libs/chunk-66C2J4IX.cjs.map +1 -0
- package/libs/{chunk-3XJC4XUG.js → chunk-6ADHES7B.js} +2 -2
- package/libs/{chunk-AOFQDQVS.cjs → chunk-6WMLG4O5.cjs} +3 -3
- package/libs/{chunk-Q7OAQLUT.js → chunk-AQAI6COH.js} +2 -2
- package/libs/{chunk-6BUJZ4DJ.cjs → chunk-BVPUT2PP.cjs} +3 -3
- package/libs/{chunk-F64GE6RG.cjs → chunk-GVVCXXKI.cjs} +4 -4
- package/libs/{chunk-75YQDONV.cjs → chunk-H4JRUNKU.cjs} +6 -6
- package/libs/{chunk-G3TFKMWB.js → chunk-H6A2CUWA.js} +5 -5
- package/libs/{chunk-2GJHKWEK.cjs → chunk-LQPWXSCK.cjs} +3 -3
- package/libs/{chunk-IBUTNPTQ.js → chunk-M5ES7OWP.js} +2 -2
- package/libs/{chunk-AWZLSWDO.js → chunk-MAG46S3P.js} +2 -2
- package/libs/{chunk-KAR3HDXK.js → chunk-MJJKNHVH.js} +2 -2
- package/libs/{chunk-5CJPTDK3.cjs → chunk-OZM455LO.cjs} +3 -3
- package/libs/{chunk-NPWHQVYB.cjs → chunk-QU5AQQ4S.cjs} +3 -3
- package/libs/{chunk-U5VA34SU.js → chunk-RQSMWB3J.js} +2 -2
- package/libs/{chunk-5QSNJQVH.cjs → chunk-S7NIA6PI.cjs} +3 -3
- package/libs/{chunk-MBWI67UT.js → chunk-SPESKPUA.js} +2 -2
- package/libs/{chunk-PMWL5XZ4.js → chunk-SQ44OCJ2.js} +3 -3
- package/libs/{chunk-EKJYOCLY.cjs → chunk-VISQ434C.cjs} +3 -3
- package/libs/{chunk-AFINOD2L.cjs → chunk-VN2CVD4H.cjs} +3 -3
- package/libs/{chunk-M5JARVJD.cjs → chunk-WTWGTWVI.cjs} +3 -3
- package/libs/{chunk-TF3GQKOY.js → chunk-X2RDXWH5.js} +2 -2
- package/libs/components/breadcrumbs/breadcrumb.cjs +6 -6
- package/libs/components/breadcrumbs/breadcrumb.d.cts +1 -1
- package/libs/components/breadcrumbs/breadcrumb.d.ts +1 -1
- package/libs/components/breadcrumbs/breadcrumb.js +3 -3
- package/libs/components/button.cjs +4 -4
- package/libs/components/button.d.cts +1 -1
- package/libs/components/button.d.ts +1 -1
- package/libs/components/button.js +2 -2
- package/libs/components/card.cjs +7 -7
- package/libs/components/card.d.cts +1 -1
- package/libs/components/card.d.ts +1 -1
- package/libs/components/card.js +2 -2
- package/libs/components/dialog/dialog.cjs +7 -7
- package/libs/components/dialog/dialog.js +5 -5
- package/libs/components/form/fields.cjs +4 -4
- package/libs/components/form/fields.d.cts +1 -1
- package/libs/components/form/fields.d.ts +1 -1
- package/libs/components/form/fields.js +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/form/select.css +1 -0
- package/libs/components/form/select.css.map +1 -0
- package/libs/components/form/select.min.css +3 -0
- package/libs/components/form/textarea.cjs +4 -4
- package/libs/components/form/textarea.js +2 -2
- package/libs/components/heading/heading.cjs +3 -3
- package/libs/components/heading/heading.d.cts +2 -2
- package/libs/components/heading/heading.d.ts +2 -2
- package/libs/components/heading/heading.js +2 -2
- package/libs/components/icons/icon.cjs +4 -4
- package/libs/components/icons/icon.d.cts +2 -2
- package/libs/components/icons/icon.d.ts +2 -2
- package/libs/components/icons/icon.js +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.cjs +6 -6
- package/libs/components/link/link.js +2 -2
- package/libs/components/list/list.cjs +5 -5
- package/libs/components/list/list.d.cts +2 -2
- package/libs/components/list/list.d.ts +2 -2
- package/libs/components/list/list.js +2 -2
- package/libs/components/modal.cjs +4 -4
- package/libs/components/modal.js +3 -3
- package/libs/components/nav/nav.cjs +7 -7
- package/libs/components/nav/nav.d.cts +2 -2
- package/libs/components/nav/nav.d.ts +2 -2
- package/libs/components/nav/nav.js +3 -3
- package/libs/components/text/text.cjs +5 -5
- package/libs/components/text/text.d.cts +1 -1
- package/libs/components/text/text.d.ts +1 -1
- package/libs/components/text/text.js +2 -2
- package/libs/{heading-81eef89a.d.ts → heading-064675b6.d.ts} +1 -1
- package/libs/hooks.cjs +4 -4
- package/libs/hooks.d.cts +1 -1
- package/libs/hooks.d.ts +1 -1
- package/libs/hooks.js +3 -3
- package/libs/{icons-df8e744f.d.ts → icons-48788561.d.ts} +1 -1
- package/libs/icons.cjs +3 -3
- package/libs/icons.d.cts +2 -2
- package/libs/icons.d.ts +2 -2
- package/libs/icons.js +2 -2
- package/libs/index.cjs +56 -55
- package/libs/index.cjs.map +1 -1
- package/libs/index.css +1 -1
- package/libs/index.css.map +1 -1
- package/libs/index.d.cts +43 -6
- package/libs/index.d.ts +43 -6
- package/libs/index.js +27 -27
- package/libs/index.js.map +1 -1
- package/libs/{list.types-d26de310.d.ts → list.types-bf2c44c1.d.ts} +1 -1
- package/libs/{ui-d01b50d4.d.ts → ui-993fc2e2.d.ts} +5 -2
- package/package.json +4 -7
- package/src/components/alert/alert.stories.tsx +1 -1
- package/src/components/alert/elements/dismiss-button.stories.tsx +1 -2
- package/src/components/badge/badge.stories.tsx +1 -1
- package/src/components/breadcrumbs/breadcrumb.stories.tsx +1 -2
- package/src/components/buttons/button.stories.tsx +1 -3
- package/src/components/cards/card.stories.tsx +1 -1
- package/src/components/cards/card.test.tsx +1 -1
- package/src/components/details/details.stories.tsx +1 -2
- package/src/components/dialog/dialog-modal.stories.tsx +1 -2
- package/src/components/dialog/dialog.stories.tsx +1 -1
- package/src/components/dialog/views/dialog-header.stories.tsx +1 -2
- package/src/components/form/CHECKBOX-STYLES.mdx +1 -1
- package/src/components/form/CHECKBOX.mdx +1 -1
- package/src/components/form/form.scss +4 -14
- package/src/components/form/form.stories.tsx +1 -1
- package/src/components/form/input.stories.tsx +1 -1
- package/src/components/form/select.scss +97 -0
- package/src/components/form/select.stories.tsx +225 -9
- package/src/components/form/select.test.tsx +541 -0
- package/src/components/form/select.tsx +133 -16
- package/src/components/heading/heading.stories.tsx +1 -2
- package/src/components/images/figure.stories.tsx +1 -2
- package/src/components/images/img.stories.tsx +1 -1
- package/src/components/layout/README.mdx +1117 -0
- package/src/components/layout/STYLES.mdx +159 -4
- package/src/components/layout/fieldset.stories.tsx +387 -0
- package/src/components/layout/landmarks.scss +115 -2
- package/src/components/layout/landmarks.stories.tsx +2 -6
- package/src/components/layout/landmarks.tsx +96 -27
- package/src/components/nav/nav.stories.tsx +1 -2
- package/src/components/text/text.stories.tsx +1 -1
- package/src/components/text-to-speech/TextToSpeech.stories.tsx +1 -1
- package/src/components/title/title.stories.tsx +1 -2
- package/src/components/ui.tsx +11 -4
- package/src/styles/form/form.css +75 -14
- package/src/styles/form/form.css.map +1 -1
- package/src/styles/form/select.css +75 -0
- package/src/styles/form/select.css.map +1 -0
- package/src/styles/index.css +157 -14
- package/src/styles/index.css.map +1 -1
- package/src/styles/layout/landmarks.css +83 -0
- package/src/styles/layout/landmarks.css.map +1 -1
- package/libs/chunk-DDSXKOUB.js +0 -7
- package/libs/chunk-DDSXKOUB.js.map +0 -1
- package/libs/chunk-EJ6KYBFE.cjs +0 -13
- package/libs/chunk-EJ6KYBFE.cjs.map +0 -1
- /package/libs/{chunk-DIJBIOFE.js.map → chunk-2ZJV6KQ3.js.map} +0 -0
- /package/libs/{chunk-LXODKKA3.cjs.map → chunk-3D6WUYSL.cjs.map} +0 -0
- /package/libs/{chunk-2JCDEC32.js.map → chunk-3ENBUQIB.js.map} +0 -0
- /package/libs/{chunk-NCGVF2QS.cjs.map → chunk-3RVZZZWX.cjs.map} +0 -0
- /package/libs/{chunk-M7JLT62Q.js.map → chunk-4F6SI5V5.js.map} +0 -0
- /package/libs/{chunk-3XJC4XUG.js.map → chunk-6ADHES7B.js.map} +0 -0
- /package/libs/{chunk-AOFQDQVS.cjs.map → chunk-6WMLG4O5.cjs.map} +0 -0
- /package/libs/{chunk-Q7OAQLUT.js.map → chunk-AQAI6COH.js.map} +0 -0
- /package/libs/{chunk-6BUJZ4DJ.cjs.map → chunk-BVPUT2PP.cjs.map} +0 -0
- /package/libs/{chunk-F64GE6RG.cjs.map → chunk-GVVCXXKI.cjs.map} +0 -0
- /package/libs/{chunk-75YQDONV.cjs.map → chunk-H4JRUNKU.cjs.map} +0 -0
- /package/libs/{chunk-G3TFKMWB.js.map → chunk-H6A2CUWA.js.map} +0 -0
- /package/libs/{chunk-2GJHKWEK.cjs.map → chunk-LQPWXSCK.cjs.map} +0 -0
- /package/libs/{chunk-IBUTNPTQ.js.map → chunk-M5ES7OWP.js.map} +0 -0
- /package/libs/{chunk-AWZLSWDO.js.map → chunk-MAG46S3P.js.map} +0 -0
- /package/libs/{chunk-KAR3HDXK.js.map → chunk-MJJKNHVH.js.map} +0 -0
- /package/libs/{chunk-5CJPTDK3.cjs.map → chunk-OZM455LO.cjs.map} +0 -0
- /package/libs/{chunk-NPWHQVYB.cjs.map → chunk-QU5AQQ4S.cjs.map} +0 -0
- /package/libs/{chunk-U5VA34SU.js.map → chunk-RQSMWB3J.js.map} +0 -0
- /package/libs/{chunk-5QSNJQVH.cjs.map → chunk-S7NIA6PI.cjs.map} +0 -0
- /package/libs/{chunk-MBWI67UT.js.map → chunk-SPESKPUA.js.map} +0 -0
- /package/libs/{chunk-PMWL5XZ4.js.map → chunk-SQ44OCJ2.js.map} +0 -0
- /package/libs/{chunk-EKJYOCLY.cjs.map → chunk-VISQ434C.cjs.map} +0 -0
- /package/libs/{chunk-AFINOD2L.cjs.map → chunk-VN2CVD4H.cjs.map} +0 -0
- /package/libs/{chunk-M5JARVJD.cjs.map → chunk-WTWGTWVI.cjs.map} +0 -0
- /package/libs/{chunk-TF3GQKOY.js.map → chunk-X2RDXWH5.js.map} +0 -0
|
@@ -5,30 +5,142 @@ import { useDisabledState } from '../../hooks/use-disabled-state'
|
|
|
5
5
|
export type { SelectProps } from './form.types'
|
|
6
6
|
import type { SelectProps } from './form.types'
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Option component props interface
|
|
10
|
+
* Extends native HTML option props with fpkit component conventions
|
|
11
|
+
*
|
|
12
|
+
* @interface OptionProps
|
|
13
|
+
*/
|
|
14
|
+
export interface OptionProps extends Omit<React.ComponentPropsWithoutRef<'option'>, 'className'> {
|
|
15
|
+
/**
|
|
16
|
+
* Value for the select option (required, unless using legacy selectValue)
|
|
17
|
+
*/
|
|
18
|
+
value?: string | number
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Display label for the option (defaults to value if not provided)
|
|
22
|
+
*/
|
|
23
|
+
label?: string
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* CSS class names (preferred over 'className' for consistency with fpkit components)
|
|
27
|
+
*/
|
|
28
|
+
classes?: string
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Inline CSS styles object
|
|
32
|
+
*/
|
|
33
|
+
styles?: React.CSSProperties
|
|
34
|
+
|
|
9
35
|
/**
|
|
10
|
-
*
|
|
36
|
+
* Disabled state for the option
|
|
37
|
+
* @default false
|
|
11
38
|
*/
|
|
12
|
-
|
|
39
|
+
disabled?: boolean
|
|
13
40
|
|
|
14
41
|
/**
|
|
15
|
-
*
|
|
42
|
+
* Children content (overrides label if provided)
|
|
16
43
|
*/
|
|
17
|
-
|
|
44
|
+
children?: React.ReactNode
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Visual variant for styling via data-option attribute
|
|
48
|
+
* Use with CSS: option[data-option="primary"] { ... }
|
|
49
|
+
* @example 'primary' | 'secondary' | 'success' | 'error'
|
|
50
|
+
*/
|
|
51
|
+
variant?: string
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Size variant for styling via data-size attribute
|
|
55
|
+
* @example 'sm' | 'md' | 'lg'
|
|
56
|
+
*/
|
|
57
|
+
size?: string
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Additional data attributes for custom styling
|
|
61
|
+
* @example { 'data-highlighted': true, 'data-category': 'premium' }
|
|
62
|
+
*/
|
|
63
|
+
dataAttributes?: Record<string, string | boolean | number>
|
|
18
64
|
}
|
|
19
65
|
|
|
20
66
|
/**
|
|
21
|
-
* Option component
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
67
|
+
* Option component - Select dropdown option element
|
|
68
|
+
*
|
|
69
|
+
* A component for creating accessible option elements within Select components.
|
|
70
|
+
* Follows fpkit component conventions with support for ref forwarding, custom styling,
|
|
71
|
+
* and consistent prop naming.
|
|
72
|
+
*
|
|
73
|
+
* @component
|
|
74
|
+
* @example
|
|
75
|
+
* // Basic option
|
|
76
|
+
* <Select.Option value="us" label="United States" />
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* // Option with children
|
|
80
|
+
* <Select.Option value="uk">
|
|
81
|
+
* United Kingdom
|
|
82
|
+
* </Select.Option>
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* // Disabled option
|
|
86
|
+
* <Select.Option value="disabled" label="Not Available" disabled />
|
|
87
|
+
*
|
|
88
|
+
* @param {OptionProps} props - Component props
|
|
89
|
+
* @returns {JSX.Element} Option element
|
|
25
90
|
*/
|
|
26
|
-
export const Option =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
91
|
+
export const Option = React.forwardRef<HTMLOptionElement, OptionProps & Partial<SelectOptionsProps>>(
|
|
92
|
+
(
|
|
93
|
+
{
|
|
94
|
+
value,
|
|
95
|
+
label,
|
|
96
|
+
classes,
|
|
97
|
+
styles,
|
|
98
|
+
disabled,
|
|
99
|
+
children,
|
|
100
|
+
variant,
|
|
101
|
+
size,
|
|
102
|
+
dataAttributes,
|
|
103
|
+
// Legacy props (backwards compatibility)
|
|
104
|
+
selectValue,
|
|
105
|
+
selectLabel,
|
|
106
|
+
...props
|
|
107
|
+
},
|
|
108
|
+
ref
|
|
109
|
+
) => {
|
|
110
|
+
// Map legacy props to new props
|
|
111
|
+
const optionValue = value ?? selectValue
|
|
112
|
+
const optionLabel = label ?? selectLabel
|
|
113
|
+
|
|
114
|
+
// Build data attributes object for styling
|
|
115
|
+
const combinedDataAttrs = {
|
|
116
|
+
...(variant && { 'data-option': variant }),
|
|
117
|
+
...(size && { 'data-size': size }),
|
|
118
|
+
...dataAttributes,
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<UI
|
|
123
|
+
as="option"
|
|
124
|
+
ref={ref}
|
|
125
|
+
value={optionValue}
|
|
126
|
+
className={classes}
|
|
127
|
+
style={styles}
|
|
128
|
+
disabled={disabled}
|
|
129
|
+
{...combinedDataAttrs}
|
|
130
|
+
{...props}
|
|
131
|
+
>
|
|
132
|
+
{children || optionLabel || optionValue}
|
|
133
|
+
</UI>
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
Option.displayName = 'Select.Option'
|
|
139
|
+
|
|
140
|
+
// Legacy type export for backwards compatibility
|
|
141
|
+
export type SelectOptionsProps = Omit<OptionProps, 'classes' | 'styles'> & {
|
|
142
|
+
selectValue: string | number
|
|
143
|
+
selectLabel?: string
|
|
32
144
|
}
|
|
33
145
|
|
|
34
146
|
/**
|
|
@@ -151,8 +263,13 @@ export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
|
|
151
263
|
|
|
152
264
|
Select.displayName = 'Select'
|
|
153
265
|
|
|
266
|
+
// Create a compound component with proper typing
|
|
267
|
+
type SelectComponent = typeof Select & {
|
|
268
|
+
Option: typeof Option
|
|
269
|
+
}
|
|
270
|
+
|
|
154
271
|
// Type assertion to allow adding static property to ForwardRefExoticComponent
|
|
155
272
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
156
273
|
;(Select as any).Option = Option
|
|
157
274
|
|
|
158
|
-
export default Select
|
|
275
|
+
export default Select as SelectComponent
|
|
@@ -7,11 +7,10 @@ import Heading from "./heading";
|
|
|
7
7
|
* @deprecated This component is deprecated. Use Title component instead.
|
|
8
8
|
*/
|
|
9
9
|
const meta: Meta<typeof Heading> = {
|
|
10
|
-
title: "FP.
|
|
10
|
+
title: "FP.React Components/Heading (Deprecated)",
|
|
11
11
|
component: Heading,
|
|
12
12
|
tags: ["version:1.0.0", "deprecated"],
|
|
13
13
|
parameters: {
|
|
14
|
-
actions: { argTypesRegex: "^on.*" },
|
|
15
14
|
docs: {
|
|
16
15
|
description: {
|
|
17
16
|
component: `
|
|
@@ -4,11 +4,10 @@ import { within, expect } from "storybook/test";
|
|
|
4
4
|
import Figure from "./figure";
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof Figure> = {
|
|
7
|
-
title: "FP.
|
|
7
|
+
title: "FP.React Components/Figure",
|
|
8
8
|
component: Figure,
|
|
9
9
|
tags: ["version:1.0.0"],
|
|
10
10
|
parameters: {
|
|
11
|
-
actions: { argTypesRegex: "^on.*" },
|
|
12
11
|
docs: {
|
|
13
12
|
description: {
|
|
14
13
|
component: `A semantic figure component for displaying images with captions, using CSS custom properties for flexible styling.
|
|
@@ -4,7 +4,7 @@ import { within, expect } from 'storybook/test'
|
|
|
4
4
|
import Img from './img'
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof Img> = {
|
|
7
|
-
title: 'FP.
|
|
7
|
+
title: 'FP.React Components/Img',
|
|
8
8
|
component: Img,
|
|
9
9
|
tags: ['version:2.0.0', 'accessibility', 'responsive'],
|
|
10
10
|
argTypes: {
|