@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.
Files changed (176) hide show
  1. package/libs/{chunk-DIJBIOFE.js → chunk-2ZJV6KQ3.js} +3 -3
  2. package/libs/{chunk-LXODKKA3.cjs → chunk-3D6WUYSL.cjs} +4 -4
  3. package/libs/{chunk-2JCDEC32.js → chunk-3ENBUQIB.js} +3 -3
  4. package/libs/{chunk-NCGVF2QS.cjs → chunk-3RVZZZWX.cjs} +4 -4
  5. package/libs/{chunk-M7JLT62Q.js → chunk-4F6SI5V5.js} +2 -2
  6. package/libs/chunk-4KJP3L35.js +7 -0
  7. package/libs/chunk-4KJP3L35.js.map +1 -0
  8. package/libs/chunk-66C2J4IX.cjs +13 -0
  9. package/libs/chunk-66C2J4IX.cjs.map +1 -0
  10. package/libs/{chunk-3XJC4XUG.js → chunk-6ADHES7B.js} +2 -2
  11. package/libs/{chunk-AOFQDQVS.cjs → chunk-6WMLG4O5.cjs} +3 -3
  12. package/libs/{chunk-Q7OAQLUT.js → chunk-AQAI6COH.js} +2 -2
  13. package/libs/{chunk-6BUJZ4DJ.cjs → chunk-BVPUT2PP.cjs} +3 -3
  14. package/libs/{chunk-F64GE6RG.cjs → chunk-GVVCXXKI.cjs} +4 -4
  15. package/libs/{chunk-75YQDONV.cjs → chunk-H4JRUNKU.cjs} +6 -6
  16. package/libs/{chunk-G3TFKMWB.js → chunk-H6A2CUWA.js} +5 -5
  17. package/libs/{chunk-2GJHKWEK.cjs → chunk-LQPWXSCK.cjs} +3 -3
  18. package/libs/{chunk-IBUTNPTQ.js → chunk-M5ES7OWP.js} +2 -2
  19. package/libs/{chunk-AWZLSWDO.js → chunk-MAG46S3P.js} +2 -2
  20. package/libs/{chunk-KAR3HDXK.js → chunk-MJJKNHVH.js} +2 -2
  21. package/libs/{chunk-5CJPTDK3.cjs → chunk-OZM455LO.cjs} +3 -3
  22. package/libs/{chunk-NPWHQVYB.cjs → chunk-QU5AQQ4S.cjs} +3 -3
  23. package/libs/{chunk-U5VA34SU.js → chunk-RQSMWB3J.js} +2 -2
  24. package/libs/{chunk-5QSNJQVH.cjs → chunk-S7NIA6PI.cjs} +3 -3
  25. package/libs/{chunk-MBWI67UT.js → chunk-SPESKPUA.js} +2 -2
  26. package/libs/{chunk-PMWL5XZ4.js → chunk-SQ44OCJ2.js} +3 -3
  27. package/libs/{chunk-EKJYOCLY.cjs → chunk-VISQ434C.cjs} +3 -3
  28. package/libs/{chunk-AFINOD2L.cjs → chunk-VN2CVD4H.cjs} +3 -3
  29. package/libs/{chunk-M5JARVJD.cjs → chunk-WTWGTWVI.cjs} +3 -3
  30. package/libs/{chunk-TF3GQKOY.js → chunk-X2RDXWH5.js} +2 -2
  31. package/libs/components/breadcrumbs/breadcrumb.cjs +6 -6
  32. package/libs/components/breadcrumbs/breadcrumb.d.cts +1 -1
  33. package/libs/components/breadcrumbs/breadcrumb.d.ts +1 -1
  34. package/libs/components/breadcrumbs/breadcrumb.js +3 -3
  35. package/libs/components/button.cjs +4 -4
  36. package/libs/components/button.d.cts +1 -1
  37. package/libs/components/button.d.ts +1 -1
  38. package/libs/components/button.js +2 -2
  39. package/libs/components/card.cjs +7 -7
  40. package/libs/components/card.d.cts +1 -1
  41. package/libs/components/card.d.ts +1 -1
  42. package/libs/components/card.js +2 -2
  43. package/libs/components/dialog/dialog.cjs +7 -7
  44. package/libs/components/dialog/dialog.js +5 -5
  45. package/libs/components/form/fields.cjs +4 -4
  46. package/libs/components/form/fields.d.cts +1 -1
  47. package/libs/components/form/fields.d.ts +1 -1
  48. package/libs/components/form/fields.js +2 -2
  49. package/libs/components/form/form.css +1 -1
  50. package/libs/components/form/form.css.map +1 -1
  51. package/libs/components/form/form.min.css +2 -2
  52. package/libs/components/form/select.css +1 -0
  53. package/libs/components/form/select.css.map +1 -0
  54. package/libs/components/form/select.min.css +3 -0
  55. package/libs/components/form/textarea.cjs +4 -4
  56. package/libs/components/form/textarea.js +2 -2
  57. package/libs/components/heading/heading.cjs +3 -3
  58. package/libs/components/heading/heading.d.cts +2 -2
  59. package/libs/components/heading/heading.d.ts +2 -2
  60. package/libs/components/heading/heading.js +2 -2
  61. package/libs/components/icons/icon.cjs +4 -4
  62. package/libs/components/icons/icon.d.cts +2 -2
  63. package/libs/components/icons/icon.d.ts +2 -2
  64. package/libs/components/icons/icon.js +2 -2
  65. package/libs/components/layout/landmarks.css +1 -1
  66. package/libs/components/layout/landmarks.css.map +1 -1
  67. package/libs/components/layout/landmarks.min.css +2 -2
  68. package/libs/components/link/link.cjs +6 -6
  69. package/libs/components/link/link.js +2 -2
  70. package/libs/components/list/list.cjs +5 -5
  71. package/libs/components/list/list.d.cts +2 -2
  72. package/libs/components/list/list.d.ts +2 -2
  73. package/libs/components/list/list.js +2 -2
  74. package/libs/components/modal.cjs +4 -4
  75. package/libs/components/modal.js +3 -3
  76. package/libs/components/nav/nav.cjs +7 -7
  77. package/libs/components/nav/nav.d.cts +2 -2
  78. package/libs/components/nav/nav.d.ts +2 -2
  79. package/libs/components/nav/nav.js +3 -3
  80. package/libs/components/text/text.cjs +5 -5
  81. package/libs/components/text/text.d.cts +1 -1
  82. package/libs/components/text/text.d.ts +1 -1
  83. package/libs/components/text/text.js +2 -2
  84. package/libs/{heading-81eef89a.d.ts → heading-064675b6.d.ts} +1 -1
  85. package/libs/hooks.cjs +4 -4
  86. package/libs/hooks.d.cts +1 -1
  87. package/libs/hooks.d.ts +1 -1
  88. package/libs/hooks.js +3 -3
  89. package/libs/{icons-df8e744f.d.ts → icons-48788561.d.ts} +1 -1
  90. package/libs/icons.cjs +3 -3
  91. package/libs/icons.d.cts +2 -2
  92. package/libs/icons.d.ts +2 -2
  93. package/libs/icons.js +2 -2
  94. package/libs/index.cjs +56 -55
  95. package/libs/index.cjs.map +1 -1
  96. package/libs/index.css +1 -1
  97. package/libs/index.css.map +1 -1
  98. package/libs/index.d.cts +43 -6
  99. package/libs/index.d.ts +43 -6
  100. package/libs/index.js +27 -27
  101. package/libs/index.js.map +1 -1
  102. package/libs/{list.types-d26de310.d.ts → list.types-bf2c44c1.d.ts} +1 -1
  103. package/libs/{ui-d01b50d4.d.ts → ui-993fc2e2.d.ts} +5 -2
  104. package/package.json +4 -7
  105. package/src/components/alert/alert.stories.tsx +1 -1
  106. package/src/components/alert/elements/dismiss-button.stories.tsx +1 -2
  107. package/src/components/badge/badge.stories.tsx +1 -1
  108. package/src/components/breadcrumbs/breadcrumb.stories.tsx +1 -2
  109. package/src/components/buttons/button.stories.tsx +1 -3
  110. package/src/components/cards/card.stories.tsx +1 -1
  111. package/src/components/cards/card.test.tsx +1 -1
  112. package/src/components/details/details.stories.tsx +1 -2
  113. package/src/components/dialog/dialog-modal.stories.tsx +1 -2
  114. package/src/components/dialog/dialog.stories.tsx +1 -1
  115. package/src/components/dialog/views/dialog-header.stories.tsx +1 -2
  116. package/src/components/form/CHECKBOX-STYLES.mdx +1 -1
  117. package/src/components/form/CHECKBOX.mdx +1 -1
  118. package/src/components/form/form.scss +4 -14
  119. package/src/components/form/form.stories.tsx +1 -1
  120. package/src/components/form/input.stories.tsx +1 -1
  121. package/src/components/form/select.scss +97 -0
  122. package/src/components/form/select.stories.tsx +225 -9
  123. package/src/components/form/select.test.tsx +541 -0
  124. package/src/components/form/select.tsx +133 -16
  125. package/src/components/heading/heading.stories.tsx +1 -2
  126. package/src/components/images/figure.stories.tsx +1 -2
  127. package/src/components/images/img.stories.tsx +1 -1
  128. package/src/components/layout/README.mdx +1117 -0
  129. package/src/components/layout/STYLES.mdx +159 -4
  130. package/src/components/layout/fieldset.stories.tsx +387 -0
  131. package/src/components/layout/landmarks.scss +115 -2
  132. package/src/components/layout/landmarks.stories.tsx +2 -6
  133. package/src/components/layout/landmarks.tsx +96 -27
  134. package/src/components/nav/nav.stories.tsx +1 -2
  135. package/src/components/text/text.stories.tsx +1 -1
  136. package/src/components/text-to-speech/TextToSpeech.stories.tsx +1 -1
  137. package/src/components/title/title.stories.tsx +1 -2
  138. package/src/components/ui.tsx +11 -4
  139. package/src/styles/form/form.css +75 -14
  140. package/src/styles/form/form.css.map +1 -1
  141. package/src/styles/form/select.css +75 -0
  142. package/src/styles/form/select.css.map +1 -0
  143. package/src/styles/index.css +157 -14
  144. package/src/styles/index.css.map +1 -1
  145. package/src/styles/layout/landmarks.css +83 -0
  146. package/src/styles/layout/landmarks.css.map +1 -1
  147. package/libs/chunk-DDSXKOUB.js +0 -7
  148. package/libs/chunk-DDSXKOUB.js.map +0 -1
  149. package/libs/chunk-EJ6KYBFE.cjs +0 -13
  150. package/libs/chunk-EJ6KYBFE.cjs.map +0 -1
  151. /package/libs/{chunk-DIJBIOFE.js.map → chunk-2ZJV6KQ3.js.map} +0 -0
  152. /package/libs/{chunk-LXODKKA3.cjs.map → chunk-3D6WUYSL.cjs.map} +0 -0
  153. /package/libs/{chunk-2JCDEC32.js.map → chunk-3ENBUQIB.js.map} +0 -0
  154. /package/libs/{chunk-NCGVF2QS.cjs.map → chunk-3RVZZZWX.cjs.map} +0 -0
  155. /package/libs/{chunk-M7JLT62Q.js.map → chunk-4F6SI5V5.js.map} +0 -0
  156. /package/libs/{chunk-3XJC4XUG.js.map → chunk-6ADHES7B.js.map} +0 -0
  157. /package/libs/{chunk-AOFQDQVS.cjs.map → chunk-6WMLG4O5.cjs.map} +0 -0
  158. /package/libs/{chunk-Q7OAQLUT.js.map → chunk-AQAI6COH.js.map} +0 -0
  159. /package/libs/{chunk-6BUJZ4DJ.cjs.map → chunk-BVPUT2PP.cjs.map} +0 -0
  160. /package/libs/{chunk-F64GE6RG.cjs.map → chunk-GVVCXXKI.cjs.map} +0 -0
  161. /package/libs/{chunk-75YQDONV.cjs.map → chunk-H4JRUNKU.cjs.map} +0 -0
  162. /package/libs/{chunk-G3TFKMWB.js.map → chunk-H6A2CUWA.js.map} +0 -0
  163. /package/libs/{chunk-2GJHKWEK.cjs.map → chunk-LQPWXSCK.cjs.map} +0 -0
  164. /package/libs/{chunk-IBUTNPTQ.js.map → chunk-M5ES7OWP.js.map} +0 -0
  165. /package/libs/{chunk-AWZLSWDO.js.map → chunk-MAG46S3P.js.map} +0 -0
  166. /package/libs/{chunk-KAR3HDXK.js.map → chunk-MJJKNHVH.js.map} +0 -0
  167. /package/libs/{chunk-5CJPTDK3.cjs.map → chunk-OZM455LO.cjs.map} +0 -0
  168. /package/libs/{chunk-NPWHQVYB.cjs.map → chunk-QU5AQQ4S.cjs.map} +0 -0
  169. /package/libs/{chunk-U5VA34SU.js.map → chunk-RQSMWB3J.js.map} +0 -0
  170. /package/libs/{chunk-5QSNJQVH.cjs.map → chunk-S7NIA6PI.cjs.map} +0 -0
  171. /package/libs/{chunk-MBWI67UT.js.map → chunk-SPESKPUA.js.map} +0 -0
  172. /package/libs/{chunk-PMWL5XZ4.js.map → chunk-SQ44OCJ2.js.map} +0 -0
  173. /package/libs/{chunk-EKJYOCLY.cjs.map → chunk-VISQ434C.cjs.map} +0 -0
  174. /package/libs/{chunk-AFINOD2L.cjs.map → chunk-VN2CVD4H.cjs.map} +0 -0
  175. /package/libs/{chunk-M5JARVJD.cjs.map → chunk-WTWGTWVI.cjs.map} +0 -0
  176. /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
- export type SelectOptionsProps = {
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
- * Label for the select option
36
+ * Disabled state for the option
37
+ * @default false
11
38
  */
12
- selectLabel: string
39
+ disabled?: boolean
13
40
 
14
41
  /**
15
- * Value for the select option. Can be a number or string.
42
+ * Children content (overrides label if provided)
16
43
  */
17
- selectValue: string
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 for select.
22
- * @param {SelectOptionsProps} param0 - The component props.
23
- * @param {string} param0.selectValue - Value for the option.
24
- * @param {string} [param0.selectLabel] - Label for the option.
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 = ({ selectValue, selectLabel }: SelectOptionsProps) => {
27
- return (
28
- <option value={selectValue}>
29
- {selectLabel || selectValue}
30
- </option>
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.REACT Components/Heading (Deprecated)",
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.REACT Components/Figure",
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.REACT Components/Img',
7
+ title: 'FP.React Components/Img',
8
8
  component: Img,
9
9
  tags: ['version:2.0.0', 'accessibility', 'responsive'],
10
10
  argTypes: {