@ankhorage/zora 14.0.1 → 15.0.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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/dist/features/app-bar/adapters/inbound/AppBar.d.ts.map +1 -1
- package/dist/features/app-bar/adapters/inbound/AppBar.js +28 -27
- package/dist/features/app-bar/adapters/inbound/AppBar.js.map +1 -1
- package/dist/features/app-bar/public.d.ts +1 -1
- package/dist/features/app-bar/public.d.ts.map +1 -1
- package/dist/features/app-bar/public.js.map +1 -1
- package/dist/features/bottom-sheet/public.d.ts +2 -2
- package/dist/features/bottom-sheet/public.d.ts.map +1 -1
- package/dist/features/bottom-sheet/public.js +1 -1
- package/dist/features/bottom-sheet/public.js.map +1 -1
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.d.ts +5 -0
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.d.ts.map +1 -0
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.js +81 -0
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.js.map +1 -0
- package/dist/features/breadcrumbs/breadcrumbsMeta.d.ts +119 -0
- package/dist/features/breadcrumbs/breadcrumbsMeta.d.ts.map +1 -0
- package/dist/features/breadcrumbs/breadcrumbsMeta.js +94 -0
- package/dist/features/breadcrumbs/breadcrumbsMeta.js.map +1 -0
- package/dist/features/breadcrumbs/public.d.ts +3 -0
- package/dist/features/breadcrumbs/public.d.ts.map +1 -0
- package/dist/features/breadcrumbs/public.js +2 -0
- package/dist/features/breadcrumbs/public.js.map +1 -0
- package/dist/features/button/utils/resolveButtonThemeRecipe.d.ts +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.d.ts.map +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.js +4 -2
- package/dist/features/data-table/adapters/inbound/DataTable.js.map +1 -1
- package/dist/features/form/formFieldMeta.d.ts +1 -1
- package/dist/features/form/formFieldMeta.js +1 -1
- package/dist/features/form/formFieldMeta.js.map +1 -1
- package/dist/features/form/radio/utils/resolveRadioGroupThemeRecipe.d.ts +1 -1
- package/dist/features/form/select/adapters/inbound/Select.d.ts +2 -0
- package/dist/features/form/select/adapters/inbound/Select.d.ts.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.js +2 -0
- package/dist/features/form/select/adapters/inbound/Select.js.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.native.d.ts +5 -0
- package/dist/features/form/select/adapters/inbound/Select.native.d.ts.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.native.js +42 -0
- package/dist/features/form/select/adapters/inbound/Select.native.js.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.web.d.ts +5 -0
- package/dist/features/form/select/adapters/inbound/Select.web.d.ts.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.web.js +31 -0
- package/dist/features/form/select/adapters/inbound/Select.web.js.map +1 -0
- package/dist/features/form/select/composition/SelectField.d.ts +10 -0
- package/dist/features/form/select/composition/SelectField.d.ts.map +1 -0
- package/dist/features/form/select/composition/SelectField.js +8 -0
- package/dist/features/form/select/composition/SelectField.js.map +1 -0
- package/dist/features/form/select/composition/SelectOptionRow.d.ts +12 -0
- package/dist/features/form/select/composition/SelectOptionRow.d.ts.map +1 -0
- package/dist/features/form/select/composition/SelectOptionRow.js +9 -0
- package/dist/features/form/select/composition/SelectOptionRow.js.map +1 -0
- package/dist/features/form/select/composition/SelectTrigger.d.ts +10 -0
- package/dist/features/form/select/composition/SelectTrigger.d.ts.map +1 -0
- package/dist/features/form/select/composition/SelectTrigger.js +9 -0
- package/dist/features/form/select/composition/SelectTrigger.js.map +1 -0
- package/dist/features/form/select/composition/useSelectController.d.ts +8 -0
- package/dist/features/form/select/composition/useSelectController.d.ts.map +1 -0
- package/dist/features/form/select/composition/useSelectController.js +15 -0
- package/dist/features/form/select/composition/useSelectController.js.map +1 -0
- package/dist/features/form/select/public.d.ts +3 -0
- package/dist/features/form/select/public.d.ts.map +1 -0
- package/dist/features/form/select/public.js +2 -0
- package/dist/features/form/select/public.js.map +1 -0
- package/dist/features/form/select/selectMeta.d.ts +195 -0
- package/dist/features/form/select/selectMeta.d.ts.map +1 -0
- package/dist/features/form/select/selectMeta.js +152 -0
- package/dist/features/form/select/selectMeta.js.map +1 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.d.ts +5 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.d.ts.map +1 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js +43 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js.map +1 -0
- package/dist/features/popover-menu/popoverMenuMeta.d.ts +9 -0
- package/dist/features/popover-menu/popoverMenuMeta.d.ts.map +1 -0
- package/dist/features/popover-menu/popoverMenuMeta.js +9 -0
- package/dist/features/popover-menu/popoverMenuMeta.js.map +1 -0
- package/dist/features/popover-menu/public.d.ts +3 -0
- package/dist/features/popover-menu/public.d.ts.map +1 -0
- package/dist/features/popover-menu/public.js +2 -0
- package/dist/features/popover-menu/public.js.map +1 -0
- package/dist/features/typography/utils/resolveHeadingThemeRecipe.d.ts +1 -1
- package/dist/features/typography/utils/resolveTextThemeRecipe.d.ts +1 -1
- package/dist/index.d.ts +4 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/metadata/bindableComponentMeta.d.ts +1 -2
- package/dist/metadata/bindableComponentMeta.d.ts.map +1 -1
- package/dist/metadata/bindableComponentMeta.js +1 -2
- package/dist/metadata/bindableComponentMeta.js.map +1 -1
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +4 -5
- package/dist/metadata/componentMeta.js.map +1 -1
- package/dist/patterns/theme-composer/ThemeComposer.js +1 -1
- package/dist/patterns/theme-composer/ThemeComposer.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +4 -5
- package/dist/registry.js.map +1 -1
- package/dist/types/app-bar.d.ts +6 -3
- package/dist/types/app-bar.d.ts.map +1 -1
- package/dist/types/app-bar.js.map +1 -1
- package/dist/{components/breadcrumbs/types.d.ts → types/breadcrumbs.d.ts} +8 -6
- package/dist/types/breadcrumbs.d.ts.map +1 -0
- package/dist/types/breadcrumbs.js +2 -0
- package/dist/types/breadcrumbs.js.map +1 -0
- package/dist/types/data-table.d.ts +2 -2
- package/dist/types/data-table.d.ts.map +1 -1
- package/dist/types/data-table.js.map +1 -1
- package/dist/types/popover-menu.d.ts +24 -0
- package/dist/types/popover-menu.d.ts.map +1 -0
- package/dist/types/popover-menu.js +2 -0
- package/dist/types/popover-menu.js.map +1 -0
- package/dist/types/select.d.ts +22 -0
- package/dist/types/select.d.ts.map +1 -0
- package/dist/types/select.js +2 -0
- package/dist/types/select.js.map +1 -0
- package/package.json +2 -4
- package/src/features/app-bar/adapters/inbound/AppBar.tsx +50 -42
- package/src/features/app-bar/public.ts +1 -1
- package/src/features/bottom-sheet/public.test.ts +10 -1
- package/src/features/bottom-sheet/public.ts +9 -1
- package/src/features/breadcrumbs/adapters/inbound/Breadcrumbs.tsx +179 -0
- package/src/features/breadcrumbs/breadcrumbsMeta.ts +95 -0
- package/src/features/breadcrumbs/public.test.ts +22 -0
- package/src/features/breadcrumbs/public.ts +6 -0
- package/src/features/data-table/adapters/inbound/DataTable.tsx +9 -5
- package/src/features/form/formFieldMeta.ts +1 -1
- package/src/features/form/select/adapters/inbound/Select.native.tsx +78 -0
- package/src/features/form/select/adapters/inbound/Select.tsx +1 -0
- package/src/features/form/select/adapters/inbound/Select.web.tsx +63 -0
- package/src/features/form/select/composition/SelectField.tsx +27 -0
- package/src/features/form/select/composition/SelectOptionRow.tsx +36 -0
- package/src/features/form/select/composition/SelectTrigger.tsx +32 -0
- package/src/features/form/select/composition/useSelectController.ts +21 -0
- package/src/features/form/select/public.test.ts +25 -0
- package/src/features/form/select/public.ts +2 -0
- package/src/features/form/select/selectMeta.ts +154 -0
- package/src/features/popover-menu/adapters/inbound/PopoverMenu.tsx +60 -0
- package/src/{components/breadcrumbs/meta.ts → features/popover-menu/popoverMenuMeta.ts} +3 -3
- package/src/features/popover-menu/public.test.ts +11 -0
- package/src/features/popover-menu/public.ts +6 -0
- package/src/index.ts +14 -7
- package/src/interactionPolicy.test.ts +19 -21
- package/src/metadata/bindableComponentMeta.test.ts +8 -0
- package/src/metadata/bindableComponentMeta.ts +1 -2
- package/src/metadata/componentMeta.test.ts +3 -0
- package/src/metadata/componentMeta.ts +4 -5
- package/src/nativePeerContract.test.ts +5 -19
- package/src/patterns/theme-composer/ThemeComposer.tsx +1 -1
- package/src/platformAcceptance.test.ts +1 -1
- package/src/registry.ts +4 -5
- package/src/theme/themeScopeStructure.test.ts +8 -3
- package/src/types/app-bar.ts +6 -3
- package/src/{components/breadcrumbs/types.ts → types/breadcrumbs.ts} +8 -5
- package/src/types/data-table.ts +2 -2
- package/src/types/popover-menu.ts +31 -0
- package/src/{components/select/types.ts → types/select.ts} +11 -3
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +0 -7
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts.map +0 -1
- package/dist/components/breadcrumbs/Breadcrumbs.js +0 -80
- package/dist/components/breadcrumbs/Breadcrumbs.js.map +0 -1
- package/dist/components/breadcrumbs/index.d.ts +0 -3
- package/dist/components/breadcrumbs/index.d.ts.map +0 -1
- package/dist/components/breadcrumbs/index.js +0 -2
- package/dist/components/breadcrumbs/index.js.map +0 -1
- package/dist/components/breadcrumbs/meta.d.ts +0 -9
- package/dist/components/breadcrumbs/meta.d.ts.map +0 -1
- package/dist/components/breadcrumbs/meta.js +0 -9
- package/dist/components/breadcrumbs/meta.js.map +0 -1
- package/dist/components/breadcrumbs/types.d.ts.map +0 -1
- package/dist/components/breadcrumbs/types.js +0 -2
- package/dist/components/breadcrumbs/types.js.map +0 -1
- package/dist/components/menu/DropdownMenu.d.ts +0 -7
- package/dist/components/menu/DropdownMenu.d.ts.map +0 -1
- package/dist/components/menu/DropdownMenu.js +0 -9
- package/dist/components/menu/DropdownMenu.js.map +0 -1
- package/dist/components/menu/Menu.d.ts +0 -7
- package/dist/components/menu/Menu.d.ts.map +0 -1
- package/dist/components/menu/Menu.js +0 -46
- package/dist/components/menu/Menu.js.map +0 -1
- package/dist/components/menu/index.d.ts +0 -4
- package/dist/components/menu/index.d.ts.map +0 -1
- package/dist/components/menu/index.js +0 -3
- package/dist/components/menu/index.js.map +0 -1
- package/dist/components/menu/meta.d.ts +0 -17
- package/dist/components/menu/meta.d.ts.map +0 -1
- package/dist/components/menu/meta.js +0 -17
- package/dist/components/menu/meta.js.map +0 -1
- package/dist/components/menu/types.d.ts +0 -22
- package/dist/components/menu/types.d.ts.map +0 -1
- package/dist/components/menu/types.js +0 -2
- package/dist/components/menu/types.js.map +0 -1
- package/dist/components/select/Select.d.ts +0 -7
- package/dist/components/select/Select.d.ts.map +0 -1
- package/dist/components/select/Select.js +0 -32
- package/dist/components/select/Select.js.map +0 -1
- package/dist/components/select/index.d.ts +0 -3
- package/dist/components/select/index.d.ts.map +0 -1
- package/dist/components/select/index.js +0 -3
- package/dist/components/select/index.js.map +0 -1
- package/dist/components/select/meta.d.ts +0 -9
- package/dist/components/select/meta.d.ts.map +0 -1
- package/dist/components/select/meta.js +0 -9
- package/dist/components/select/meta.js.map +0 -1
- package/dist/components/select/types.d.ts +0 -14
- package/dist/components/select/types.d.ts.map +0 -1
- package/dist/components/select/types.js +0 -2
- package/dist/components/select/types.js.map +0 -1
- package/src/components/breadcrumbs/Breadcrumbs.tsx +0 -147
- package/src/components/breadcrumbs/index.ts +0 -2
- package/src/components/menu/DropdownMenu.tsx +0 -11
- package/src/components/menu/Menu.tsx +0 -59
- package/src/components/menu/index.ts +0 -3
- package/src/components/menu/meta.ts +0 -19
- package/src/components/menu/types.ts +0 -31
- package/src/components/select/Select.tsx +0 -67
- package/src/components/select/index.ts +0 -2
- package/src/components/select/meta.ts +0 -10
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,WAAW,CAAiC,EACnD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,OAAO,EACP,aAAa,EACb,QAAQ,EACR,OAAO,EACP,MAAM,EACN,iBAAiB,GACG;IACpB,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,OAAO,GAAG,iBAAiB,KAAK,SAAS,CAAC;IAEhD,OAAO,CACL,CAAC,GAAG,CACF,EAAE,CAAC,SAAS,CACZ,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAChE,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAC5B,MAAM,CAAC,GAAG,CACV,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CACxD;QAAA,CAAC,MAAM,CACL,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CACnB,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE;YAC3B,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,aAAa,CAAC,SAAS,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC,CAAC,CACF,aAAa,CAAC,CAAC,KAAK,CAAC,CACrB,KAAK,CAAC,CAAC;YACL,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,MAAM;YACb,eAAe,EAAE,aAAa;YAC9B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;YACxB,WAAW,EAAE,CAAC;SACf,CAAC,CAEF;UAAA,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,CAAC,MAAM,CAAC,IAAI,CACV,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAClB,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAC1B,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACpB,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACpB,CACH,CAAC,CACJ;QAAA,EAAE,MAAM,CACV;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC","sourcesContent":["import { Picker } from '@react-native-picker/picker';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { Box } from '../../features/layout/public';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { SelectProps } from './types';\n\nfunction SelectInner<TValue extends string = string>({\n themeId: _themeId,\n mode: _mode,\n value,\n options,\n onValueChange,\n disabled,\n invalid,\n testID,\n interactionPolicy,\n}: SelectProps<TValue>) {\n const { theme } = useZoraTheme();\n const passive = interactionPolicy === 'passive';\n\n return (\n <Box\n bg=\"surface\"\n borderColor={invalid ? theme.colors.error : theme.colors.border}\n borderWidth={1}\n opacity={disabled ? 0.5 : 1}\n radius=\"m\"\n testID={testID}\n >\n <View style={{ pointerEvents: passive ? 'none' : 'auto' }}>\n <Picker\n enabled={!disabled}\n onValueChange={(itemValue) => {\n if (!passive) {\n onValueChange(itemValue);\n }\n }}\n selectedValue={value}\n style={{\n height: 44,\n width: '100%',\n backgroundColor: 'transparent',\n color: theme.colors.text,\n borderWidth: 0,\n }}\n >\n {options.map((option) => (\n <Picker.Item\n key={option.value}\n enabled={!option.disabled}\n label={option.label}\n value={option.value}\n />\n ))}\n </Picker>\n </View>\n </Box>\n );\n}\n\n/***\n * Select control for choosing a value from a list of options.\n */\nexport const Select = withZoraThemeScope(SelectInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/select/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/select/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC","sourcesContent":["export * from './Select';\nexport * from './types';\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const selectMeta: {
|
|
2
|
-
readonly name: "Select";
|
|
3
|
-
readonly category: "component";
|
|
4
|
-
readonly directManifestNode: false;
|
|
5
|
-
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly note: "Form control component; not represented as a manifest node in v1.";
|
|
7
|
-
readonly props: {};
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/select/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;CAOe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/select/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,mEAAmE;IACzE,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const selectMeta = {\n name: 'Select',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Form control component; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
2
|
-
export interface SelectOption<TValue extends string = string> {
|
|
3
|
-
value: TValue;
|
|
4
|
-
label: string;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface SelectProps<TValue extends string = string> extends ZoraBaseProps {
|
|
8
|
-
value: TValue;
|
|
9
|
-
options: readonly SelectOption<TValue>[];
|
|
10
|
-
onValueChange: (value: TValue) => void;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
invalid?: boolean;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/select/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,YAAY,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,aAAa;IAChF,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;IACzC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/select/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface SelectOption<TValue extends string = string> {\n value: TValue;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectProps<TValue extends string = string> extends ZoraBaseProps {\n value: TValue;\n options: readonly SelectOption<TValue>[];\n onValueChange: (value: TValue) => void;\n disabled?: boolean;\n invalid?: boolean;\n}\n"]}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Button } from '../../features/button/public';
|
|
4
|
-
import { Icon } from '../../features/icon/public';
|
|
5
|
-
import { Text } from '../../features/typography/public';
|
|
6
|
-
import { Inline } from '../../foundation';
|
|
7
|
-
import { resolveIconSize } from '../../internal/recipes';
|
|
8
|
-
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
9
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
10
|
-
import type { BreadcrumbItem, BreadcrumbsProps } from './types';
|
|
11
|
-
|
|
12
|
-
type BreadcrumbRenderItem =
|
|
13
|
-
| {
|
|
14
|
-
item: BreadcrumbItem;
|
|
15
|
-
type: 'item';
|
|
16
|
-
}
|
|
17
|
-
| {
|
|
18
|
-
type: 'ellipsis';
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
function normalizeMaxItems(value: number | undefined): number | undefined {
|
|
22
|
-
if (value === undefined || !Number.isFinite(value)) {
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return Math.max(0, Math.trunc(value));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function createRenderItems(
|
|
30
|
-
items: readonly BreadcrumbItem[],
|
|
31
|
-
maxItems: number | undefined,
|
|
32
|
-
): readonly BreadcrumbRenderItem[] {
|
|
33
|
-
if (maxItems === undefined || maxItems === 0 || items.length <= maxItems || maxItems < 3) {
|
|
34
|
-
return items.map((item) => ({ item, type: 'item' }));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const [firstItem] = items;
|
|
38
|
-
if (firstItem === undefined) {
|
|
39
|
-
return [];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const trailingCount = maxItems - 2;
|
|
43
|
-
const trailingItems = items.slice(items.length - trailingCount);
|
|
44
|
-
|
|
45
|
-
return [
|
|
46
|
-
{ item: firstItem, type: 'item' },
|
|
47
|
-
{ type: 'ellipsis' },
|
|
48
|
-
...trailingItems.map((item) => ({ item, type: 'item' }) satisfies BreadcrumbRenderItem),
|
|
49
|
-
];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function renderSeparator(separator: React.ReactNode) {
|
|
53
|
-
return (
|
|
54
|
-
<Text emphasis="muted" variant="bodySmall">
|
|
55
|
-
{separator}
|
|
56
|
-
</Text>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function BreadcrumbLabel({ item, compact }: { item: BreadcrumbItem; compact: boolean }) {
|
|
61
|
-
const { theme } = useZoraTheme();
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<Inline align="center" gap="xs" wrap="nowrap">
|
|
65
|
-
{item.icon ? (
|
|
66
|
-
<Icon
|
|
67
|
-
{...item.icon}
|
|
68
|
-
color={theme.semantics.content.muted}
|
|
69
|
-
size={resolveIconSize(compact ? 's' : 'm')}
|
|
70
|
-
/>
|
|
71
|
-
) : null}
|
|
72
|
-
<Text emphasis="muted" variant={compact ? 'caption' : 'bodySmall'}>
|
|
73
|
-
{item.label}
|
|
74
|
-
</Text>
|
|
75
|
-
</Inline>
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function BreadcrumbsInner({
|
|
80
|
-
themeId: _themeId,
|
|
81
|
-
mode: _mode,
|
|
82
|
-
interactionPolicy,
|
|
83
|
-
items,
|
|
84
|
-
separator = '/',
|
|
85
|
-
maxItems,
|
|
86
|
-
compact = false,
|
|
87
|
-
disabled = false,
|
|
88
|
-
testID,
|
|
89
|
-
}: BreadcrumbsProps) {
|
|
90
|
-
const normalizedMaxItems = normalizeMaxItems(maxItems);
|
|
91
|
-
const renderItems = createRenderItems(items, normalizedMaxItems);
|
|
92
|
-
const currentItemId = items.at(-1)?.id;
|
|
93
|
-
|
|
94
|
-
if (items.length === 0) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return (
|
|
99
|
-
<Inline align="center" gap={compact ? 'xs' : 's'} testID={testID} wrap="wrap">
|
|
100
|
-
{renderItems.map((renderItem, index) => {
|
|
101
|
-
const isLastRenderedItem = index === renderItems.length - 1;
|
|
102
|
-
const showSeparator = !isLastRenderedItem;
|
|
103
|
-
|
|
104
|
-
if (renderItem.type === 'ellipsis') {
|
|
105
|
-
return (
|
|
106
|
-
<React.Fragment key="ellipsis">
|
|
107
|
-
<Text emphasis="muted" variant={compact ? 'caption' : 'bodySmall'}>
|
|
108
|
-
…
|
|
109
|
-
</Text>
|
|
110
|
-
{showSeparator ? renderSeparator(separator) : null}
|
|
111
|
-
</React.Fragment>
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const { item } = renderItem;
|
|
116
|
-
const current = item.id === currentItemId;
|
|
117
|
-
const interactive = !current && !disabled && !item.disabled && Boolean(item.onPress);
|
|
118
|
-
|
|
119
|
-
return (
|
|
120
|
-
<React.Fragment key={item.id}>
|
|
121
|
-
{interactive ? (
|
|
122
|
-
<Button
|
|
123
|
-
color="neutral"
|
|
124
|
-
interactionPolicy={interactionPolicy}
|
|
125
|
-
leadingIcon={item.icon}
|
|
126
|
-
onPress={item.onPress}
|
|
127
|
-
size={compact ? 's' : 'm'}
|
|
128
|
-
testID={testID ? `${testID}-item-${item.id}` : undefined}
|
|
129
|
-
variant="ghost"
|
|
130
|
-
>
|
|
131
|
-
{item.label}
|
|
132
|
-
</Button>
|
|
133
|
-
) : (
|
|
134
|
-
<BreadcrumbLabel item={item} compact={compact} />
|
|
135
|
-
)}
|
|
136
|
-
{showSeparator ? renderSeparator(separator) : null}
|
|
137
|
-
</React.Fragment>
|
|
138
|
-
);
|
|
139
|
-
})}
|
|
140
|
-
</Inline>
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/***
|
|
145
|
-
* Renders a breadcrumb trail for hierarchical navigation.
|
|
146
|
-
*/
|
|
147
|
-
export const Breadcrumbs = withZoraThemeScope(BreadcrumbsInner);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import { Menu } from './Menu';
|
|
4
|
-
import type { DropdownMenuProps } from './types';
|
|
5
|
-
|
|
6
|
-
/***
|
|
7
|
-
* Convenience wrapper for rendering a `Menu` as a dropdown.
|
|
8
|
-
*/
|
|
9
|
-
export function DropdownMenu(props: DropdownMenuProps) {
|
|
10
|
-
return <Menu {...props} />;
|
|
11
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Menu as SurfaceMenu, type MenuAction as SurfaceMenuAction } from '@ankhorage/surface';
|
|
2
|
-
import React, { useMemo } from 'react';
|
|
3
|
-
|
|
4
|
-
import { Icon } from '../../features/icon/public';
|
|
5
|
-
import { Box } from '../../features/layout/public';
|
|
6
|
-
import { resolveIconSize } from '../../internal/recipes';
|
|
7
|
-
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
8
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
9
|
-
import type { MenuAction, MenuProps } from './types';
|
|
10
|
-
|
|
11
|
-
function renderActionLeading(action: MenuAction, iconColor: string) {
|
|
12
|
-
if (action.leading) {
|
|
13
|
-
return action.leading;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
if (!action.icon) {
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return <Icon {...action.icon} color={iconColor} size={resolveIconSize('s')} />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function renderActionTrailing(action: MenuAction) {
|
|
24
|
-
if (!action.trailing) {
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return <Box>{action.trailing}</Box>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function toSurfaceAction(action: MenuAction, iconColor: string): SurfaceMenuAction {
|
|
32
|
-
return {
|
|
33
|
-
activate: action.onPress,
|
|
34
|
-
description: action.description,
|
|
35
|
-
disabled: action.disabled,
|
|
36
|
-
id: action.id,
|
|
37
|
-
intent: action.intent,
|
|
38
|
-
leading: renderActionLeading(action, iconColor),
|
|
39
|
-
selected: action.selected,
|
|
40
|
-
title: action.title,
|
|
41
|
-
trailing: renderActionTrailing(action),
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function MenuInner({ themeId: _themeId, mode: _mode, actions, onDismiss, ...props }: MenuProps) {
|
|
46
|
-
const { theme } = useZoraTheme();
|
|
47
|
-
const iconColor = theme.semantics.content.muted;
|
|
48
|
-
const surfaceActions = useMemo(
|
|
49
|
-
() => actions.map((action) => toSurfaceAction(action, iconColor)),
|
|
50
|
-
[actions, iconColor],
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
return <SurfaceMenu {...props} actions={surfaceActions} dismiss={onDismiss} />;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/***
|
|
57
|
-
* Presents a list of actions as a menu with optional icons and intent styling.
|
|
58
|
-
*/
|
|
59
|
-
export const Menu = withZoraThemeScope(MenuInner);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
-
|
|
3
|
-
export const menuMeta = {
|
|
4
|
-
name: 'Menu',
|
|
5
|
-
category: 'component',
|
|
6
|
-
directManifestNode: false,
|
|
7
|
-
allowedChildren: [],
|
|
8
|
-
note: 'Surface-backed action menu; not represented as a manifest node in v1.',
|
|
9
|
-
props: {},
|
|
10
|
-
} as const satisfies ZoraComponentMeta;
|
|
11
|
-
|
|
12
|
-
export const dropdownMenuMeta = {
|
|
13
|
-
name: 'DropdownMenu',
|
|
14
|
-
category: 'component',
|
|
15
|
-
directManifestNode: false,
|
|
16
|
-
allowedChildren: [],
|
|
17
|
-
note: 'Product-facing alias for Menu trigger/action composition; not represented as a manifest node in v1.',
|
|
18
|
-
props: {},
|
|
19
|
-
} as const satisfies ZoraComponentMeta;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ButtonIconSpec,
|
|
3
|
-
MenuActionIntent as SurfaceMenuActionIntent,
|
|
4
|
-
MenuProps as SurfaceMenuProps,
|
|
5
|
-
} from '@ankhorage/surface';
|
|
6
|
-
import type React from 'react';
|
|
7
|
-
|
|
8
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
9
|
-
|
|
10
|
-
export type MenuActionIntent = SurfaceMenuActionIntent;
|
|
11
|
-
|
|
12
|
-
export interface MenuAction {
|
|
13
|
-
id: string;
|
|
14
|
-
title: React.ReactNode;
|
|
15
|
-
description?: React.ReactNode;
|
|
16
|
-
icon?: ButtonIconSpec;
|
|
17
|
-
leading?: React.ReactNode;
|
|
18
|
-
trailing?: React.ReactNode;
|
|
19
|
-
intent?: MenuActionIntent;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
selected?: boolean;
|
|
22
|
-
onPress?: () => void;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface MenuProps
|
|
26
|
-
extends ZoraBaseProps, Omit<SurfaceMenuProps, 'actions' | 'dismiss' | 'mode' | 'themeId'> {
|
|
27
|
-
actions: readonly MenuAction[];
|
|
28
|
-
onDismiss?: () => void;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type DropdownMenuProps = MenuProps;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Picker } from '@react-native-picker/picker';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { View } from 'react-native';
|
|
4
|
-
|
|
5
|
-
import { Box } from '../../features/layout/public';
|
|
6
|
-
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
7
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
8
|
-
import type { SelectProps } from './types';
|
|
9
|
-
|
|
10
|
-
function SelectInner<TValue extends string = string>({
|
|
11
|
-
themeId: _themeId,
|
|
12
|
-
mode: _mode,
|
|
13
|
-
value,
|
|
14
|
-
options,
|
|
15
|
-
onValueChange,
|
|
16
|
-
disabled,
|
|
17
|
-
invalid,
|
|
18
|
-
testID,
|
|
19
|
-
interactionPolicy,
|
|
20
|
-
}: SelectProps<TValue>) {
|
|
21
|
-
const { theme } = useZoraTheme();
|
|
22
|
-
const passive = interactionPolicy === 'passive';
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<Box
|
|
26
|
-
bg="surface"
|
|
27
|
-
borderColor={invalid ? theme.colors.error : theme.colors.border}
|
|
28
|
-
borderWidth={1}
|
|
29
|
-
opacity={disabled ? 0.5 : 1}
|
|
30
|
-
radius="m"
|
|
31
|
-
testID={testID}
|
|
32
|
-
>
|
|
33
|
-
<View style={{ pointerEvents: passive ? 'none' : 'auto' }}>
|
|
34
|
-
<Picker
|
|
35
|
-
enabled={!disabled}
|
|
36
|
-
onValueChange={(itemValue) => {
|
|
37
|
-
if (!passive) {
|
|
38
|
-
onValueChange(itemValue);
|
|
39
|
-
}
|
|
40
|
-
}}
|
|
41
|
-
selectedValue={value}
|
|
42
|
-
style={{
|
|
43
|
-
height: 44,
|
|
44
|
-
width: '100%',
|
|
45
|
-
backgroundColor: 'transparent',
|
|
46
|
-
color: theme.colors.text,
|
|
47
|
-
borderWidth: 0,
|
|
48
|
-
}}
|
|
49
|
-
>
|
|
50
|
-
{options.map((option) => (
|
|
51
|
-
<Picker.Item
|
|
52
|
-
key={option.value}
|
|
53
|
-
enabled={!option.disabled}
|
|
54
|
-
label={option.label}
|
|
55
|
-
value={option.value}
|
|
56
|
-
/>
|
|
57
|
-
))}
|
|
58
|
-
</Picker>
|
|
59
|
-
</View>
|
|
60
|
-
</Box>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/***
|
|
65
|
-
* Select control for choosing a value from a list of options.
|
|
66
|
-
*/
|
|
67
|
-
export const Select = withZoraThemeScope(SelectInner);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
-
|
|
3
|
-
export const selectMeta = {
|
|
4
|
-
name: 'Select',
|
|
5
|
-
category: 'component',
|
|
6
|
-
directManifestNode: false,
|
|
7
|
-
allowedChildren: [],
|
|
8
|
-
note: 'Form control component; not represented as a manifest node in v1.',
|
|
9
|
-
props: {},
|
|
10
|
-
} as const satisfies ZoraComponentMeta;
|