@ankhorage/zora 0.3.10 → 0.4.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 (38) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +98 -0
  3. package/dist/components/checkbox/CheckboxGroup.d.ts +4 -0
  4. package/dist/components/checkbox/CheckboxGroup.d.ts.map +1 -0
  5. package/dist/components/checkbox/CheckboxGroup.js +31 -0
  6. package/dist/components/checkbox/CheckboxGroup.js.map +1 -0
  7. package/dist/components/checkbox/index.d.ts +5 -0
  8. package/dist/components/checkbox/index.d.ts.map +1 -0
  9. package/dist/components/checkbox/index.js +3 -0
  10. package/dist/components/checkbox/index.js.map +1 -0
  11. package/dist/components/checkbox/types.d.ts +17 -0
  12. package/dist/components/checkbox/types.d.ts.map +1 -0
  13. package/dist/components/checkbox/types.js +2 -0
  14. package/dist/components/checkbox/types.js.map +1 -0
  15. package/dist/components/radio/RadioGroup.d.ts +4 -0
  16. package/dist/components/radio/RadioGroup.d.ts.map +1 -0
  17. package/dist/components/radio/RadioGroup.js +28 -0
  18. package/dist/components/radio/RadioGroup.js.map +1 -0
  19. package/dist/components/radio/index.d.ts +5 -0
  20. package/dist/components/radio/index.d.ts.map +1 -0
  21. package/dist/components/radio/index.js +3 -0
  22. package/dist/components/radio/index.js.map +1 -0
  23. package/dist/components/radio/types.d.ts +17 -0
  24. package/dist/components/radio/types.d.ts.map +1 -0
  25. package/dist/components/radio/types.js +2 -0
  26. package/dist/components/radio/types.js.map +1 -0
  27. package/dist/index.d.ts +4 -0
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +2 -0
  30. package/dist/index.js.map +1 -1
  31. package/package.json +1 -1
  32. package/src/components/checkbox/CheckboxGroup.tsx +103 -0
  33. package/src/components/checkbox/index.ts +4 -0
  34. package/src/components/checkbox/types.ts +21 -0
  35. package/src/components/radio/RadioGroup.tsx +96 -0
  36. package/src/components/radio/index.ts +4 -0
  37. package/src/components/radio/types.ts +21 -0
  38. package/src/index.ts +4 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e6ea86b: Add RadioGroup and CheckboxGroup components built on Surface primitives.
8
+
3
9
  ## 0.3.10
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -238,6 +238,104 @@ Inherits all Surface `TextInputProps` except `leadingAccessory`, `size`, and
238
238
 
239
239
  </details>
240
240
 
241
+ ### `RadioGroup`
242
+
243
+ Single-selection control built on top of Surface `Radio`, designed for use inside `FormField`.
244
+
245
+ ```tsx
246
+ <FormField label="Navigator type">
247
+ <RadioGroup
248
+ value="tabs"
249
+ onValueChange={(value) => console.log(value)}
250
+ options={[
251
+ { value: 'tabs', label: 'Tabs' },
252
+ { value: 'drawer', label: 'Drawer' },
253
+ ]}
254
+ />
255
+ </FormField>
256
+ ```
257
+
258
+ <details>
259
+ <summary>Props</summary>
260
+
261
+ ZORA props:
262
+
263
+ | Prop | Type | Default | Notes |
264
+ | --------------- | ---------------------------- | ------------ | ------------------------------ |
265
+ | `value` | `string` | - | Currently selected value. |
266
+ | `onValueChange` | `(value: string) => void` | - | Called when selection changes. |
267
+ | `options` | `RadioGroupOption[]` | - | List of selectable options. |
268
+ | `orientation` | `'horizontal' \| 'vertical'` | `'vertical'` | Layout direction. |
269
+ | `gap` | `'xs' \| 's' \| 'm' \| 'l'` | `'s'` | Spacing between items. |
270
+
271
+ Option shape:
272
+
273
+ ```ts
274
+ type RadioGroupOption = {
275
+ value: string;
276
+ label: React.ReactNode;
277
+ description?: React.ReactNode;
278
+ disabled?: boolean;
279
+ };
280
+ ```
281
+
282
+ Inherited props:
283
+
284
+ Passes `tone`, `size`, `invalid`, `readOnly`, `disabled`, and `testID`
285
+ to underlying Surface `Radio` components.
286
+
287
+ </details>
288
+
289
+ ---
290
+
291
+ ### `CheckboxGroup`
292
+
293
+ Multi-selection control built on top of Surface `Checkbox`, for selecting multiple values.
294
+
295
+ ```tsx
296
+ <FormField label="Features">
297
+ <CheckboxGroup
298
+ value={['a']}
299
+ onValueChange={(value) => console.log(value)}
300
+ options={[
301
+ { value: 'a', label: 'Feature A' },
302
+ { value: 'b', label: 'Feature B' },
303
+ ]}
304
+ />
305
+ </FormField>
306
+ ```
307
+
308
+ <details>
309
+ <summary>Props</summary>
310
+
311
+ ZORA props:
312
+
313
+ | Prop | Type | Default | Notes |
314
+ | --------------- | ---------------------------- | ------------ | ------------------------------ |
315
+ | `value` | `string[]` | - | Array of selected values. |
316
+ | `onValueChange` | `(value: string[]) => void` | - | Called when selection changes. |
317
+ | `options` | `CheckboxGroupOption[]` | - | List of selectable options. |
318
+ | `orientation` | `'horizontal' \| 'vertical'` | `'vertical'` | Layout direction. |
319
+ | `gap` | `'xs' \| 's' \| 'm' \| 'l'` | `'s'` | Spacing between items. |
320
+
321
+ Option shape:
322
+
323
+ ```ts
324
+ type CheckboxGroupOption = {
325
+ value: string;
326
+ label: React.ReactNode;
327
+ description?: React.ReactNode;
328
+ disabled?: boolean;
329
+ };
330
+ ```
331
+
332
+ Inherited props:
333
+
334
+ Passes `tone`, `size`, `invalid`, `readOnly`, `disabled`, and `testID`
335
+ to underlying Surface `Checkbox` components.
336
+
337
+ </details>
338
+
241
339
  ### `Textarea`
242
340
 
243
341
  Multiline text input wrapper with ZORA sizing and optional Surface icon specs.
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { CheckboxGroupProps } from './types';
3
+ export declare function CheckboxGroup<TValue extends string>({ value, onValueChange, options, orientation, gap, tone, size, invalid, readOnly, disabled, testID, }: CheckboxGroupProps<TValue>): React.JSX.Element;
4
+ //# sourceMappingURL=CheckboxGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/CheckboxGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAuB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEvE,wBAAgB,aAAa,CAAC,MAAM,SAAS,MAAM,EAAE,EACnD,KAAK,EACL,aAAa,EACb,OAAO,EACP,WAAwB,EACxB,GAAS,EACT,IAAgB,EAChB,IAAU,EACV,OAAe,EACf,QAAgB,EAChB,QAAgB,EAChB,MAAM,GACP,EAAE,kBAAkB,CAAC,MAAM,CAAC,qBAkC5B"}
@@ -0,0 +1,31 @@
1
+ import { Checkbox, Stack, Text } from '@ankhorage/surface';
2
+ import React from 'react';
3
+ import { View } from 'react-native';
4
+ export function CheckboxGroup({ value, onValueChange, options, orientation = 'vertical', gap = 's', tone = 'primary', size = 'm', invalid = false, readOnly = false, disabled = false, testID, }) {
5
+ const selectedValues = new Set(value);
6
+ const isHorizontal = orientation === 'horizontal';
7
+ return (<View testID={testID} style={{
8
+ flexDirection: isHorizontal ? 'row' : 'column',
9
+ flexWrap: isHorizontal ? 'wrap' : 'nowrap',
10
+ }}>
11
+ <Stack direction={isHorizontal ? 'row' : 'column'} gap={gap} wrap={isHorizontal ? 'wrap' : 'nowrap'}>
12
+ {options.map((option) => (<CheckboxGroupItem key={option.value} option={option} checked={selectedValues.has(option.value)} disabled={disabled || option.disabled === true} invalid={invalid} readOnly={readOnly} size={size} tone={tone} value={value} onValueChange={onValueChange}/>))}
13
+ </Stack>
14
+ </View>);
15
+ }
16
+ function CheckboxGroupItem({ option, checked, disabled, invalid, readOnly, size, tone, value, onValueChange, }) {
17
+ return (<Checkbox checked={checked} disabled={disabled} invalid={invalid} readOnly={readOnly} size={size} tone={tone} testID={option.testID} onCheckedChange={(nextChecked) => {
18
+ const nextValue = nextChecked
19
+ ? [...value, option.value]
20
+ : value.filter((currentValue) => currentValue !== option.value);
21
+ onValueChange(nextValue);
22
+ }}>
23
+ <Stack gap="xs">
24
+ <Text>{option.label}</Text>
25
+ {option.description ? (<Text variant="caption" tone="muted">
26
+ {option.description}
27
+ </Text>) : null}
28
+ </Stack>
29
+ </Checkbox>);
30
+ }
31
+ //# sourceMappingURL=CheckboxGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckboxGroup.js","sourceRoot":"","sources":["../../../src/components/checkbox/CheckboxGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIpC,MAAM,UAAU,aAAa,CAAwB,EACnD,KAAK,EACL,aAAa,EACb,OAAO,EACP,WAAW,GAAG,UAAU,EACxB,GAAG,GAAG,GAAG,EACT,IAAI,GAAG,SAAS,EAChB,IAAI,GAAG,GAAG,EACV,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,MAAM,GACqB;IAC3B,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,YAAY,GAAG,WAAW,KAAK,YAAY,CAAC;IAElD,OAAO,CACL,CAAC,IAAI,CACH,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC;YACL,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;YAC9C,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;SAC3C,CAAC,CAEF;MAAA,CAAC,KAAK,CACJ,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAC3C,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAEvC;QAAA,CAAC,OAAO,CAAC,GAAG,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C,YAAY,EAAE,EAAE,CAAC,YAAY,KAAK,MAAM,CAAC,KAAK,CAAC,CAAC;YAElE,aAAa,CAAC,SAAS,CAAC,CAAC;QAC3B,CAAC,CAAC,CAEF;MAAA,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CACb;QAAA,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,CAC1B;QAAA,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CACpB,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAClC;YAAA,CAAC,MAAM,CAAC,WAAW,CACrB;UAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;MAAA,EAAE,KAAK,CACT;IAAA,EAAE,QAAQ,CAAC,CACZ,CAAC;AACJ,CAAC","sourcesContent":["import { Checkbox, Stack, Text } from '@ankhorage/surface';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport type { CheckboxGroupOption, CheckboxGroupProps } from './types';\n\nexport function CheckboxGroup<TValue extends string>({\n value,\n onValueChange,\n options,\n orientation = 'vertical',\n gap = 's',\n tone = 'primary',\n size = 'm',\n invalid = false,\n readOnly = false,\n disabled = false,\n testID,\n}: CheckboxGroupProps<TValue>) {\n const selectedValues = new Set(value);\n const isHorizontal = orientation === 'horizontal';\n\n return (\n <View\n testID={testID}\n style={{\n flexDirection: isHorizontal ? 'row' : 'column',\n flexWrap: isHorizontal ? 'wrap' : 'nowrap',\n }}\n >\n <Stack\n direction={isHorizontal ? 'row' : 'column'}\n gap={gap}\n wrap={isHorizontal ? 'wrap' : 'nowrap'}\n >\n {options.map((option) => (\n <CheckboxGroupItem\n key={option.value}\n option={option}\n checked={selectedValues.has(option.value)}\n disabled={disabled || option.disabled === true}\n invalid={invalid}\n readOnly={readOnly}\n size={size}\n tone={tone}\n value={value}\n onValueChange={onValueChange}\n />\n ))}\n </Stack>\n </View>\n );\n}\n\nfunction CheckboxGroupItem<TValue extends string>({\n option,\n checked,\n disabled,\n invalid,\n readOnly,\n size,\n tone,\n value,\n onValueChange,\n}: {\n option: CheckboxGroupOption<TValue>;\n checked: boolean;\n disabled: boolean;\n invalid: boolean;\n readOnly: boolean;\n size: NonNullable<CheckboxGroupProps<TValue>['size']>;\n tone: NonNullable<CheckboxGroupProps<TValue>['tone']>;\n value: readonly TValue[];\n onValueChange: (value: TValue[]) => void;\n}) {\n return (\n <Checkbox\n checked={checked}\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n size={size}\n tone={tone}\n testID={option.testID}\n onCheckedChange={(nextChecked) => {\n const nextValue = nextChecked\n ? [...value, option.value]\n : value.filter((currentValue) => currentValue !== option.value);\n\n onValueChange(nextValue);\n }}\n >\n <Stack gap=\"xs\">\n <Text>{option.label}</Text>\n {option.description ? (\n <Text variant=\"caption\" tone=\"muted\">\n {option.description}\n </Text>\n ) : null}\n </Stack>\n </Checkbox>\n );\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export { CheckboxGroup } from './CheckboxGroup';
2
+ export type { CheckboxGroupOption, CheckboxGroupProps } from './types';
3
+ export type { CheckboxProps } from '@ankhorage/surface';
4
+ export { Checkbox } from '@ankhorage/surface';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACvE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { CheckboxGroup } from './CheckboxGroup';
2
+ export { Checkbox } from '@ankhorage/surface';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { CheckboxGroup } from './CheckboxGroup';\nexport type { CheckboxGroupOption, CheckboxGroupProps } from './types';\nexport type { CheckboxProps } from '@ankhorage/surface';\nexport { Checkbox } from '@ankhorage/surface';\n"]}
@@ -0,0 +1,17 @@
1
+ import type { CheckboxProps } from '@ankhorage/surface';
2
+ import type React from 'react';
3
+ export interface CheckboxGroupOption<TValue extends string> {
4
+ value: TValue;
5
+ label: React.ReactNode;
6
+ description?: React.ReactNode;
7
+ disabled?: boolean;
8
+ testID?: string;
9
+ }
10
+ export interface CheckboxGroupProps<TValue extends string> extends Pick<CheckboxProps, 'tone' | 'size' | 'invalid' | 'readOnly' | 'disabled' | 'testID'> {
11
+ value: readonly TValue[];
12
+ onValueChange: (value: TValue[]) => void;
13
+ options: readonly CheckboxGroupOption<TValue>[];
14
+ orientation?: 'horizontal' | 'vertical';
15
+ gap?: 'xs' | 's' | 'm' | 'l';
16
+ }
17
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,mBAAmB,CAAC,MAAM,SAAS,MAAM;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB,CAAC,MAAM,SAAS,MAAM,CAAE,SAAQ,IAAI,CACrE,aAAa,EACb,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CACjE;IACC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC,OAAO,EAAE,SAAS,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC;IAChD,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,GAAG,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAC9B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/checkbox/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { CheckboxProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nexport interface CheckboxGroupOption<TValue extends string> {\n value: TValue;\n label: React.ReactNode;\n description?: React.ReactNode;\n disabled?: boolean;\n testID?: string;\n}\n\nexport interface CheckboxGroupProps<TValue extends string> extends Pick<\n CheckboxProps,\n 'tone' | 'size' | 'invalid' | 'readOnly' | 'disabled' | 'testID'\n> {\n value: readonly TValue[];\n onValueChange: (value: TValue[]) => void;\n options: readonly CheckboxGroupOption<TValue>[];\n orientation?: 'horizontal' | 'vertical';\n gap?: 'xs' | 's' | 'm' | 'l';\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { RadioGroupProps } from './types';
3
+ export declare function RadioGroup<TValue extends string>({ value, onValueChange, options, orientation, gap, tone, size, invalid, readOnly, disabled, testID, }: RadioGroupProps<TValue>): React.JSX.Element;
4
+ //# sourceMappingURL=RadioGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/radio/RadioGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,SAAS,CAAC;AAEjE,wBAAgB,UAAU,CAAC,MAAM,SAAS,MAAM,EAAE,EAChD,KAAK,EACL,aAAa,EACb,OAAO,EACP,WAAwB,EACxB,GAAS,EACT,IAAgB,EAChB,IAAU,EACV,OAAe,EACf,QAAgB,EAChB,QAAgB,EAChB,MAAM,GACP,EAAE,eAAe,CAAC,MAAM,CAAC,qBAiCzB"}
@@ -0,0 +1,28 @@
1
+ import { Radio, Stack, Text } from '@ankhorage/surface';
2
+ import React from 'react';
3
+ import { View } from 'react-native';
4
+ export function RadioGroup({ value, onValueChange, options, orientation = 'vertical', gap = 's', tone = 'primary', size = 'm', invalid = false, readOnly = false, disabled = false, testID, }) {
5
+ const isHorizontal = orientation === 'horizontal';
6
+ return (<View testID={testID} accessibilityRole="radiogroup" style={{
7
+ flexDirection: isHorizontal ? 'row' : 'column',
8
+ flexWrap: isHorizontal ? 'wrap' : 'nowrap',
9
+ }}>
10
+ <Stack direction={isHorizontal ? 'row' : 'column'} gap={gap} wrap={isHorizontal ? 'wrap' : 'nowrap'}>
11
+ {options.map((option) => (<RadioGroupItem key={option.value} option={option} checked={value === option.value} disabled={disabled || option.disabled === true} invalid={invalid} readOnly={readOnly} size={size} tone={tone} onSelect={onValueChange}/>))}
12
+ </Stack>
13
+ </View>);
14
+ }
15
+ function RadioGroupItem({ option, checked, disabled, invalid, readOnly, size, tone, onSelect, }) {
16
+ return (<Radio checked={checked} disabled={disabled} invalid={invalid} readOnly={readOnly} size={size} tone={tone} testID={option.testID} onCheckedChange={(nextChecked) => {
17
+ if (nextChecked)
18
+ onSelect(option.value);
19
+ }}>
20
+ <Stack gap="xs">
21
+ <Text>{option.label}</Text>
22
+ {option.description ? (<Text variant="caption" tone="muted">
23
+ {option.description}
24
+ </Text>) : null}
25
+ </Stack>
26
+ </Radio>);
27
+ }
28
+ //# sourceMappingURL=RadioGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../../src/components/radio/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIpC,MAAM,UAAU,UAAU,CAAwB,EAChD,KAAK,EACL,aAAa,EACb,OAAO,EACP,WAAW,GAAG,UAAU,EACxB,GAAG,GAAG,GAAG,EACT,IAAI,GAAG,SAAS,EAChB,IAAI,GAAG,GAAG,EACV,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,MAAM,GACkB;IACxB,MAAM,YAAY,GAAG,WAAW,KAAK,YAAY,CAAC;IAElD,OAAO,CACL,CAAC,IAAI,CACH,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,iBAAiB,CAAC,YAAY,CAC9B,KAAK,CAAC,CAAC;YACL,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;YAC9C,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;SAC3C,CAAC,CAEF;MAAA,CAAC,KAAK,CACJ,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAC3C,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAEvC;QAAA,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,CAAC,cAAc,CACb,GAAG,CAAC,CAA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O,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAClC;YAAA,CAAC,MAAM,CAAC,WAAW,CACrB;UAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;MAAA,EAAE,KAAK,CACT;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC","sourcesContent":["import { Radio, Stack, Text } from '@ankhorage/surface';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport type { RadioGroupOption, RadioGroupProps } from './types';\n\nexport function RadioGroup<TValue extends string>({\n value,\n onValueChange,\n options,\n orientation = 'vertical',\n gap = 's',\n tone = 'primary',\n size = 'm',\n invalid = false,\n readOnly = false,\n disabled = false,\n testID,\n}: RadioGroupProps<TValue>) {\n const isHorizontal = orientation === 'horizontal';\n\n return (\n <View\n testID={testID}\n accessibilityRole=\"radiogroup\"\n style={{\n flexDirection: isHorizontal ? 'row' : 'column',\n flexWrap: isHorizontal ? 'wrap' : 'nowrap',\n }}\n >\n <Stack\n direction={isHorizontal ? 'row' : 'column'}\n gap={gap}\n wrap={isHorizontal ? 'wrap' : 'nowrap'}\n >\n {options.map((option) => (\n <RadioGroupItem\n key={option.value}\n option={option}\n checked={value === option.value}\n disabled={disabled || option.disabled === true}\n invalid={invalid}\n readOnly={readOnly}\n size={size}\n tone={tone}\n onSelect={onValueChange}\n />\n ))}\n </Stack>\n </View>\n );\n}\n\nfunction RadioGroupItem<TValue extends string>({\n option,\n checked,\n disabled,\n invalid,\n readOnly,\n size,\n tone,\n onSelect,\n}: {\n option: RadioGroupOption<TValue>;\n checked: boolean;\n disabled: boolean;\n invalid: boolean;\n readOnly: boolean;\n size: NonNullable<RadioGroupProps<TValue>['size']>;\n tone: NonNullable<RadioGroupProps<TValue>['tone']>;\n onSelect: (value: TValue) => void;\n}) {\n return (\n <Radio\n checked={checked}\n disabled={disabled}\n invalid={invalid}\n readOnly={readOnly}\n size={size}\n tone={tone}\n testID={option.testID}\n onCheckedChange={(nextChecked) => {\n if (nextChecked) onSelect(option.value);\n }}\n >\n <Stack gap=\"xs\">\n <Text>{option.label}</Text>\n {option.description ? (\n <Text variant=\"caption\" tone=\"muted\">\n {option.description}\n </Text>\n ) : null}\n </Stack>\n </Radio>\n );\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export { RadioGroup } from './RadioGroup';
2
+ export type { RadioGroupOption, RadioGroupProps } from './types';
3
+ export type { RadioProps } from '@ankhorage/surface';
4
+ export { Radio } from '@ankhorage/surface';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/radio/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { RadioGroup } from './RadioGroup';
2
+ export { Radio } from '@ankhorage/surface';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/radio/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { RadioGroup } from './RadioGroup';\nexport type { RadioGroupOption, RadioGroupProps } from './types';\nexport type { RadioProps } from '@ankhorage/surface';\nexport { Radio } from '@ankhorage/surface';\n"]}
@@ -0,0 +1,17 @@
1
+ import type { RadioProps } from '@ankhorage/surface';
2
+ import type React from 'react';
3
+ export interface RadioGroupOption<TValue extends string> {
4
+ value: TValue;
5
+ label: React.ReactNode;
6
+ description?: React.ReactNode;
7
+ disabled?: boolean;
8
+ testID?: string;
9
+ }
10
+ export interface RadioGroupProps<TValue extends string> extends Pick<RadioProps, 'tone' | 'size' | 'invalid' | 'readOnly' | 'disabled' | 'testID'> {
11
+ value: TValue;
12
+ onValueChange: (value: TValue) => void;
13
+ options: readonly RadioGroupOption<TValue>[];
14
+ orientation?: 'horizontal' | 'vertical';
15
+ gap?: 'xs' | 's' | 'm' | 'l';
16
+ }
17
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/radio/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,gBAAgB,CAAC,MAAM,SAAS,MAAM;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe,CAAC,MAAM,SAAS,MAAM,CAAE,SAAQ,IAAI,CAClE,UAAU,EACV,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CACjE;IACC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,OAAO,EAAE,SAAS,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;IAC7C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,GAAG,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAC9B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/radio/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { RadioProps } from '@ankhorage/surface';\nimport type React from 'react';\n\nexport interface RadioGroupOption<TValue extends string> {\n value: TValue;\n label: React.ReactNode;\n description?: React.ReactNode;\n disabled?: boolean;\n testID?: string;\n}\n\nexport interface RadioGroupProps<TValue extends string> extends Pick<\n RadioProps,\n 'tone' | 'size' | 'invalid' | 'readOnly' | 'disabled' | 'testID'\n> {\n value: TValue;\n onValueChange: (value: TValue) => void;\n options: readonly RadioGroupOption<TValue>[];\n orientation?: 'horizontal' | 'vertical';\n gap?: 'xs' | 's' | 'm' | 'l';\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -4,6 +4,8 @@ export type { ButtonProps } from './components/button';
4
4
  export { Button } from './components/button';
5
5
  export type { CardProps } from './components/card';
6
6
  export { Card } from './components/card';
7
+ export type { CheckboxGroupOption, CheckboxGroupProps, CheckboxProps } from './components/checkbox';
8
+ export { Checkbox, CheckboxGroup } from './components/checkbox';
7
9
  export type { DrawerProps } from './components/drawer';
8
10
  export { Drawer } from './components/drawer';
9
11
  export type { IconProps } from './components/icon';
@@ -14,6 +16,8 @@ export type { InputProps } from './components/input';
14
16
  export { Input } from './components/input';
15
17
  export type { ModalProps } from './components/modal';
16
18
  export { Modal } from './components/modal';
19
+ export type { RadioGroupOption, RadioGroupProps, RadioProps } from './components/radio';
20
+ export { Radio, RadioGroup } from './components/radio';
17
21
  export type { SelectOption, SelectProps } from './components/select';
18
22
  export { Select } from './components/select';
19
23
  export type { TabItem, TabsProps } from './components/tabs';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE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EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,11 +1,13 @@
1
1
  export { Badge } from './components/badge';
2
2
  export { Button } from './components/button';
3
3
  export { Card } from './components/card';
4
+ export { Checkbox, CheckboxGroup } from './components/checkbox';
4
5
  export { Drawer } from './components/drawer';
5
6
  export { Icon } from './components/icon';
6
7
  export { IconButton } from './components/icon-button';
7
8
  export { Input } from './components/input';
8
9
  export { Modal } from './components/modal';
10
+ export { Radio, RadioGroup } from './components/radio';
9
11
  export { Select } from './components/select';
10
12
  export { Tabs } from './components/tabs';
11
13
  export { Textarea } from './components/textarea';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAAE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ps } from './components/button';\nexport { Button } from './components/button';\nexport type { CardProps } from './components/card';\nexport { Card } from './components/card';\nexport type { DrawerProps } from './components/drawer';\nexport { Drawer } from './components/drawer';\nexport type { IconProps } from './components/icon';\nexport { Icon } from './components/icon';\nexport type { IconButtonProps } from './components/icon-button';\nexport { IconButton } from './components/icon-button';\nexport type { InputProps } from './components/input';\nexport { Input } from './components/input';\nexport type { ModalProps } from './components/modal';\nexport { Modal } from './components/modal';\nexport type { SelectOption, SelectProps } from './components/select';\nexport { Select } from './components/select';\nexport type { TabItem, TabsProps } from './components/tabs';\nexport { Tabs } from './components/tabs';\nexport type { TextareaProps } from './components/textarea';\nexport { Textarea } from './components/textarea';\nexport type { ToolbarActionProps, ToolbarProps } from './components/toolbar';\nexport { Toolbar, ToolbarAction } from './components/toolbar';\nexport type { AppShellProps } from './layout/app-shell';\nexport { AppShell } from './layout/app-shell';\nexport type { AuthLayoutProps } from './layout/auth-layout';\nexport { AuthLayout } from './layout/auth-layout';\nexport type { PageProps } from './layout/page';\nexport { Page } from './layout/page';\nexport type { PageHeaderProps } from './layout/page-header';\nexport { PageHeader } from './layout/page-header';\nexport type { PageSectionProps } from './layout/page-section';\nexport { PageSection } from './layout/page-section';\nexport type { SettingsLayoutProps } from './layout/settings-layout';\nexport { SettingsLayout } from './layout/settings-layout';\nexport type { SidebarLayoutProps } from './layout/sidebar-layout';\nexport { SidebarLayout } from './layout/sidebar-layout';\nexport type { TopbarLayoutProps } from './layout/topbar-layout';\nexport { TopbarLayout } from './layout/topbar-layout';\nexport type {\n CollectionEditorProps,\n CollectionEditorRenderItemProps,\n} from './patterns/collection-editor';\nexport { CollectionEditor } from './patterns/collection-editor';\nexport type { ConfirmDialogProps } from './patterns/confirm-dialog';\nexport { ConfirmDialog } from './patterns/confirm-dialog';\nexport type { DisclosureSectionProps } from './patterns/disclosure-section';\nexport { DisclosureSection } from './patterns/disclosure-section';\nexport type { EmptyStateAction, EmptyStateProps } from './patterns/empty-state';\nexport { EmptyState } from './patterns/empty-state';\nexport type { FormFieldProps } from './patterns/form-field';\nexport { FormField } from './patterns/form-field';\nexport type { InspectorFieldProps } from './patterns/inspector-field';\nexport { InspectorField } from './patterns/inspector-field';\nexport type { NoticeProps } from './patterns/notice';\nexport { Notice } from './patterns/notice';\nexport type { PanelProps } from './patterns/panel';\nexport { Panel } from './patterns/panel';\nexport type { ResponsivePanelProps } from './patterns/responsive-panel';\nexport { ResponsivePanel } from './patterns/responsive-panel';\nexport type { SectionHeaderProps } from './patterns/section-header';\nexport { SectionHeader } from './patterns/section-header';\nexport type { SettingsRowProps } from './patterns/settings-row';\nexport { SettingsRow } from './patterns/settings-row';\nexport type { SwitchFieldProps } from './patterns/switch-field';\nexport { SwitchField } from './patterns/switch-field';\nexport type { PaletteItemProps, TileGridProps } from './patterns/tile-grid';\nexport { PaletteItem, TileGrid } from './patterns/tile-grid';\nexport type { TreeItemNode, TreeItemRenderProps, TreeViewProps } from './patterns/tree-view';\nexport { TreeItem, TreeView } from './patterns/tree-view';\nexport * from './theme';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MA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AAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,SAAS,CAAC","sourcesContent":["export type { BadgeProps } from './components/badge';\nexport { Badge } from './components/badge';\nexport type { ButtonProps } from './components/button';\nexport { Button } from './components/button';\nexport type { CardProps } from './components/card';\nexport { Card } from './components/card';\nexport type { CheckboxGroupOption, CheckboxGroupProps, CheckboxProps } from './components/checkbox';\nexport { Checkbox, CheckboxGroup } from './components/checkbox';\nexport type { DrawerProps } from './components/drawer';\nexport { Drawer } from './components/drawer';\nexport type { IconProps } from './components/icon';\nexport { Icon } from './components/icon';\nexport type { IconButtonProps } from './components/icon-button';\nexport { IconButton } from './components/icon-button';\nexport type { InputProps } from './components/input';\nexport { Input } from './components/input';\nexport type { ModalProps } from './components/modal';\nexport { Modal } from './components/modal';\nexport type { RadioGroupOption, RadioGroupProps, RadioProps } from './components/radio';\nexport { Radio, RadioGroup } from './components/radio';\nexport type { SelectOption, SelectProps } from './components/select';\nexport { Select } from './components/select';\nexport type { TabItem, TabsProps } from './components/tabs';\nexport { Tabs } from './components/tabs';\nexport type { TextareaProps } from './components/textarea';\nexport { Textarea } from './components/textarea';\nexport type { ToolbarActionProps, ToolbarProps } from './components/toolbar';\nexport { Toolbar, ToolbarAction } from './components/toolbar';\nexport type { AppShellProps } from './layout/app-shell';\nexport { AppShell } from './layout/app-shell';\nexport type { AuthLayoutProps } from './layout/auth-layout';\nexport { AuthLayout } from './layout/auth-layout';\nexport type { PageProps } from './layout/page';\nexport { Page } from './layout/page';\nexport type { PageHeaderProps } from './layout/page-header';\nexport { PageHeader } from './layout/page-header';\nexport type { PageSectionProps } from './layout/page-section';\nexport { PageSection } from './layout/page-section';\nexport type { SettingsLayoutProps } from './layout/settings-layout';\nexport { SettingsLayout } from './layout/settings-layout';\nexport type { SidebarLayoutProps } from './layout/sidebar-layout';\nexport { SidebarLayout } from './layout/sidebar-layout';\nexport type { TopbarLayoutProps } from './layout/topbar-layout';\nexport { TopbarLayout } from './layout/topbar-layout';\nexport type {\n CollectionEditorProps,\n CollectionEditorRenderItemProps,\n} from './patterns/collection-editor';\nexport { CollectionEditor } from './patterns/collection-editor';\nexport type { ConfirmDialogProps } from './patterns/confirm-dialog';\nexport { ConfirmDialog } from './patterns/confirm-dialog';\nexport type { DisclosureSectionProps } from './patterns/disclosure-section';\nexport { DisclosureSection } from './patterns/disclosure-section';\nexport type { EmptyStateAction, EmptyStateProps } from './patterns/empty-state';\nexport { EmptyState } from './patterns/empty-state';\nexport type { FormFieldProps } from './patterns/form-field';\nexport { FormField } from './patterns/form-field';\nexport type { InspectorFieldProps } from './patterns/inspector-field';\nexport { InspectorField } from './patterns/inspector-field';\nexport type { NoticeProps } from './patterns/notice';\nexport { Notice } from './patterns/notice';\nexport type { PanelProps } from './patterns/panel';\nexport { Panel } from './patterns/panel';\nexport type { ResponsivePanelProps } from './patterns/responsive-panel';\nexport { ResponsivePanel } from './patterns/responsive-panel';\nexport type { SectionHeaderProps } from './patterns/section-header';\nexport { SectionHeader } from './patterns/section-header';\nexport type { SettingsRowProps } from './patterns/settings-row';\nexport { SettingsRow } from './patterns/settings-row';\nexport type { SwitchFieldProps } from './patterns/switch-field';\nexport { SwitchField } from './patterns/switch-field';\nexport type { PaletteItemProps, TileGridProps } from './patterns/tile-grid';\nexport { PaletteItem, TileGrid } from './patterns/tile-grid';\nexport type { TreeItemNode, TreeItemRenderProps, TreeViewProps } from './patterns/tree-view';\nexport { TreeItem, TreeView } from './patterns/tree-view';\nexport * from './theme';\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/zora",
3
3
  "type": "module",
4
- "version": "0.3.10",
4
+ "version": "0.4.0",
5
5
  "description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
6
6
  "homepage": "https://github.com/ankhorage/zora#readme",
7
7
  "bugs": {
@@ -0,0 +1,103 @@
1
+ import { Checkbox, Stack, Text } from '@ankhorage/surface';
2
+ import React from 'react';
3
+ import { View } from 'react-native';
4
+
5
+ import type { CheckboxGroupOption, CheckboxGroupProps } from './types';
6
+
7
+ export function CheckboxGroup<TValue extends string>({
8
+ value,
9
+ onValueChange,
10
+ options,
11
+ orientation = 'vertical',
12
+ gap = 's',
13
+ tone = 'primary',
14
+ size = 'm',
15
+ invalid = false,
16
+ readOnly = false,
17
+ disabled = false,
18
+ testID,
19
+ }: CheckboxGroupProps<TValue>) {
20
+ const selectedValues = new Set(value);
21
+ const isHorizontal = orientation === 'horizontal';
22
+
23
+ return (
24
+ <View
25
+ testID={testID}
26
+ style={{
27
+ flexDirection: isHorizontal ? 'row' : 'column',
28
+ flexWrap: isHorizontal ? 'wrap' : 'nowrap',
29
+ }}
30
+ >
31
+ <Stack
32
+ direction={isHorizontal ? 'row' : 'column'}
33
+ gap={gap}
34
+ wrap={isHorizontal ? 'wrap' : 'nowrap'}
35
+ >
36
+ {options.map((option) => (
37
+ <CheckboxGroupItem
38
+ key={option.value}
39
+ option={option}
40
+ checked={selectedValues.has(option.value)}
41
+ disabled={disabled || option.disabled === true}
42
+ invalid={invalid}
43
+ readOnly={readOnly}
44
+ size={size}
45
+ tone={tone}
46
+ value={value}
47
+ onValueChange={onValueChange}
48
+ />
49
+ ))}
50
+ </Stack>
51
+ </View>
52
+ );
53
+ }
54
+
55
+ function CheckboxGroupItem<TValue extends string>({
56
+ option,
57
+ checked,
58
+ disabled,
59
+ invalid,
60
+ readOnly,
61
+ size,
62
+ tone,
63
+ value,
64
+ onValueChange,
65
+ }: {
66
+ option: CheckboxGroupOption<TValue>;
67
+ checked: boolean;
68
+ disabled: boolean;
69
+ invalid: boolean;
70
+ readOnly: boolean;
71
+ size: NonNullable<CheckboxGroupProps<TValue>['size']>;
72
+ tone: NonNullable<CheckboxGroupProps<TValue>['tone']>;
73
+ value: readonly TValue[];
74
+ onValueChange: (value: TValue[]) => void;
75
+ }) {
76
+ return (
77
+ <Checkbox
78
+ checked={checked}
79
+ disabled={disabled}
80
+ invalid={invalid}
81
+ readOnly={readOnly}
82
+ size={size}
83
+ tone={tone}
84
+ testID={option.testID}
85
+ onCheckedChange={(nextChecked) => {
86
+ const nextValue = nextChecked
87
+ ? [...value, option.value]
88
+ : value.filter((currentValue) => currentValue !== option.value);
89
+
90
+ onValueChange(nextValue);
91
+ }}
92
+ >
93
+ <Stack gap="xs">
94
+ <Text>{option.label}</Text>
95
+ {option.description ? (
96
+ <Text variant="caption" tone="muted">
97
+ {option.description}
98
+ </Text>
99
+ ) : null}
100
+ </Stack>
101
+ </Checkbox>
102
+ );
103
+ }
@@ -0,0 +1,4 @@
1
+ export { CheckboxGroup } from './CheckboxGroup';
2
+ export type { CheckboxGroupOption, CheckboxGroupProps } from './types';
3
+ export type { CheckboxProps } from '@ankhorage/surface';
4
+ export { Checkbox } from '@ankhorage/surface';
@@ -0,0 +1,21 @@
1
+ import type { CheckboxProps } from '@ankhorage/surface';
2
+ import type React from 'react';
3
+
4
+ export interface CheckboxGroupOption<TValue extends string> {
5
+ value: TValue;
6
+ label: React.ReactNode;
7
+ description?: React.ReactNode;
8
+ disabled?: boolean;
9
+ testID?: string;
10
+ }
11
+
12
+ export interface CheckboxGroupProps<TValue extends string> extends Pick<
13
+ CheckboxProps,
14
+ 'tone' | 'size' | 'invalid' | 'readOnly' | 'disabled' | 'testID'
15
+ > {
16
+ value: readonly TValue[];
17
+ onValueChange: (value: TValue[]) => void;
18
+ options: readonly CheckboxGroupOption<TValue>[];
19
+ orientation?: 'horizontal' | 'vertical';
20
+ gap?: 'xs' | 's' | 'm' | 'l';
21
+ }
@@ -0,0 +1,96 @@
1
+ import { Radio, Stack, Text } from '@ankhorage/surface';
2
+ import React from 'react';
3
+ import { View } from 'react-native';
4
+
5
+ import type { RadioGroupOption, RadioGroupProps } from './types';
6
+
7
+ export function RadioGroup<TValue extends string>({
8
+ value,
9
+ onValueChange,
10
+ options,
11
+ orientation = 'vertical',
12
+ gap = 's',
13
+ tone = 'primary',
14
+ size = 'm',
15
+ invalid = false,
16
+ readOnly = false,
17
+ disabled = false,
18
+ testID,
19
+ }: RadioGroupProps<TValue>) {
20
+ const isHorizontal = orientation === 'horizontal';
21
+
22
+ return (
23
+ <View
24
+ testID={testID}
25
+ accessibilityRole="radiogroup"
26
+ style={{
27
+ flexDirection: isHorizontal ? 'row' : 'column',
28
+ flexWrap: isHorizontal ? 'wrap' : 'nowrap',
29
+ }}
30
+ >
31
+ <Stack
32
+ direction={isHorizontal ? 'row' : 'column'}
33
+ gap={gap}
34
+ wrap={isHorizontal ? 'wrap' : 'nowrap'}
35
+ >
36
+ {options.map((option) => (
37
+ <RadioGroupItem
38
+ key={option.value}
39
+ option={option}
40
+ checked={value === option.value}
41
+ disabled={disabled || option.disabled === true}
42
+ invalid={invalid}
43
+ readOnly={readOnly}
44
+ size={size}
45
+ tone={tone}
46
+ onSelect={onValueChange}
47
+ />
48
+ ))}
49
+ </Stack>
50
+ </View>
51
+ );
52
+ }
53
+
54
+ function RadioGroupItem<TValue extends string>({
55
+ option,
56
+ checked,
57
+ disabled,
58
+ invalid,
59
+ readOnly,
60
+ size,
61
+ tone,
62
+ onSelect,
63
+ }: {
64
+ option: RadioGroupOption<TValue>;
65
+ checked: boolean;
66
+ disabled: boolean;
67
+ invalid: boolean;
68
+ readOnly: boolean;
69
+ size: NonNullable<RadioGroupProps<TValue>['size']>;
70
+ tone: NonNullable<RadioGroupProps<TValue>['tone']>;
71
+ onSelect: (value: TValue) => void;
72
+ }) {
73
+ return (
74
+ <Radio
75
+ checked={checked}
76
+ disabled={disabled}
77
+ invalid={invalid}
78
+ readOnly={readOnly}
79
+ size={size}
80
+ tone={tone}
81
+ testID={option.testID}
82
+ onCheckedChange={(nextChecked) => {
83
+ if (nextChecked) onSelect(option.value);
84
+ }}
85
+ >
86
+ <Stack gap="xs">
87
+ <Text>{option.label}</Text>
88
+ {option.description ? (
89
+ <Text variant="caption" tone="muted">
90
+ {option.description}
91
+ </Text>
92
+ ) : null}
93
+ </Stack>
94
+ </Radio>
95
+ );
96
+ }
@@ -0,0 +1,4 @@
1
+ export { RadioGroup } from './RadioGroup';
2
+ export type { RadioGroupOption, RadioGroupProps } from './types';
3
+ export type { RadioProps } from '@ankhorage/surface';
4
+ export { Radio } from '@ankhorage/surface';
@@ -0,0 +1,21 @@
1
+ import type { RadioProps } from '@ankhorage/surface';
2
+ import type React from 'react';
3
+
4
+ export interface RadioGroupOption<TValue extends string> {
5
+ value: TValue;
6
+ label: React.ReactNode;
7
+ description?: React.ReactNode;
8
+ disabled?: boolean;
9
+ testID?: string;
10
+ }
11
+
12
+ export interface RadioGroupProps<TValue extends string> extends Pick<
13
+ RadioProps,
14
+ 'tone' | 'size' | 'invalid' | 'readOnly' | 'disabled' | 'testID'
15
+ > {
16
+ value: TValue;
17
+ onValueChange: (value: TValue) => void;
18
+ options: readonly RadioGroupOption<TValue>[];
19
+ orientation?: 'horizontal' | 'vertical';
20
+ gap?: 'xs' | 's' | 'm' | 'l';
21
+ }
package/src/index.ts CHANGED
@@ -4,6 +4,8 @@ export type { ButtonProps } from './components/button';
4
4
  export { Button } from './components/button';
5
5
  export type { CardProps } from './components/card';
6
6
  export { Card } from './components/card';
7
+ export type { CheckboxGroupOption, CheckboxGroupProps, CheckboxProps } from './components/checkbox';
8
+ export { Checkbox, CheckboxGroup } from './components/checkbox';
7
9
  export type { DrawerProps } from './components/drawer';
8
10
  export { Drawer } from './components/drawer';
9
11
  export type { IconProps } from './components/icon';
@@ -14,6 +16,8 @@ export type { InputProps } from './components/input';
14
16
  export { Input } from './components/input';
15
17
  export type { ModalProps } from './components/modal';
16
18
  export { Modal } from './components/modal';
19
+ export type { RadioGroupOption, RadioGroupProps, RadioProps } from './components/radio';
20
+ export { Radio, RadioGroup } from './components/radio';
17
21
  export type { SelectOption, SelectProps } from './components/select';
18
22
  export { Select } from './components/select';
19
23
  export type { TabItem, TabsProps } from './components/tabs';