@app-studio/components 0.12.0 → 0.12.2
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/README.md +1 -1
- package/dist/alert.cjs.js +1 -1
- package/dist/alert.esm.mjs +1 -1
- package/dist/avatar.cjs.js +1 -1
- package/dist/avatar.esm.mjs +1 -1
- package/dist/button.cjs.js +1 -1
- package/dist/button.esm.mjs +1 -1
- package/dist/card.cjs.js +1 -1
- package/dist/card.esm.mjs +1 -1
- package/dist/checkbox.cjs.js +1 -1
- package/dist/checkbox.esm.mjs +1 -1
- package/dist/chunks/{Alert-Q1HlVX8f.mjs → Alert-B5vkpWXy.mjs} +55 -42
- package/dist/chunks/Alert-B5vkpWXy.mjs.map +1 -0
- package/dist/chunks/Alert-BHlgJZAo.cjs +2 -0
- package/dist/chunks/Alert-BHlgJZAo.cjs.map +1 -0
- package/dist/chunks/{AttachmentPreview-8d8gZ5kk.mjs → AttachmentPreview-B2-kP0Bn.mjs} +1745 -2997
- package/dist/chunks/AttachmentPreview-B2-kP0Bn.mjs.map +1 -0
- package/dist/chunks/AttachmentPreview-BZV6xSa4.cjs +2 -0
- package/dist/chunks/AttachmentPreview-BZV6xSa4.cjs.map +1 -0
- package/dist/chunks/{Avatar-D-GkyL2c.mjs → Avatar-CC1SDq6h.mjs} +34 -32
- package/dist/chunks/Avatar-CC1SDq6h.mjs.map +1 -0
- package/dist/chunks/Avatar-DtfD7QQ6.cjs +2 -0
- package/dist/chunks/Avatar-DtfD7QQ6.cjs.map +1 -0
- package/dist/chunks/Button.core-BB25t8wB.cjs +7 -0
- package/dist/chunks/Button.core-BB25t8wB.cjs.map +1 -0
- package/dist/chunks/{Button.core-Bc5cSn_z.mjs → Button.core-oxCH_VTn.mjs} +236 -222
- package/dist/chunks/Button.core-oxCH_VTn.mjs.map +1 -0
- package/dist/chunks/Button.pilot-BJK10U1-.mjs +6 -0
- package/dist/chunks/{Button.pilot-C4BIb08S.mjs.map → Button.pilot-BJK10U1-.mjs.map} +1 -1
- package/dist/chunks/Button.pilot-eWGY9Jm5.cjs +2 -0
- package/dist/chunks/{Button.pilot-JmR2DCSE.cjs.map → Button.pilot-eWGY9Jm5.cjs.map} +1 -1
- package/dist/chunks/Card-CK_D7gzP.cjs +2 -0
- package/dist/chunks/Card-CK_D7gzP.cjs.map +1 -0
- package/dist/chunks/Card-ymI5Thma.mjs +208 -0
- package/dist/chunks/Card-ymI5Thma.mjs.map +1 -0
- package/dist/chunks/Checkbox-BXbEChdd.cjs +2 -0
- package/dist/chunks/Checkbox-BXbEChdd.cjs.map +1 -0
- package/dist/chunks/Checkbox-DnwrApdj.mjs +21 -0
- package/dist/chunks/Checkbox-DnwrApdj.mjs.map +1 -0
- package/dist/chunks/Checkbox.view-B7K8ycvs.cjs +2 -0
- package/dist/chunks/Checkbox.view-B7K8ycvs.cjs.map +1 -0
- package/dist/chunks/{Checkbox.view-dhc-rfEX.mjs → Checkbox.view-CCGfVtqr.mjs} +140 -119
- package/dist/chunks/Checkbox.view-CCGfVtqr.mjs.map +1 -0
- package/dist/chunks/{Formik.Uploader-DRIyxMI0.mjs → Formik.Uploader-CIYySBWB.mjs} +18 -18
- package/dist/chunks/{Formik.Uploader-DRIyxMI0.mjs.map → Formik.Uploader-CIYySBWB.mjs.map} +1 -1
- package/dist/chunks/{Formik.Uploader-D0nzjyau.cjs → Formik.Uploader-DePTdd7A.cjs} +4 -4
- package/dist/chunks/{Formik.Uploader-D0nzjyau.cjs.map → Formik.Uploader-DePTdd7A.cjs.map} +1 -1
- package/dist/chunks/{Icon-DrAZswNH.mjs → Icon-Cy5kEVYz.mjs} +60 -60
- package/dist/chunks/{Icon-DrAZswNH.mjs.map → Icon-Cy5kEVYz.mjs.map} +1 -1
- package/dist/chunks/Modal-BzlrQQu5.cjs +2 -0
- package/dist/chunks/Modal-BzlrQQu5.cjs.map +1 -0
- package/dist/chunks/{Modal-DkckCT8-.mjs → Modal-CqbUQXoc.mjs} +92 -75
- package/dist/chunks/Modal-CqbUQXoc.mjs.map +1 -0
- package/dist/chunks/Select-CrOxhfvQ.mjs +28 -0
- package/dist/chunks/Select-CrOxhfvQ.mjs.map +1 -0
- package/dist/chunks/Select-DRMUC3NX.cjs +2 -0
- package/dist/chunks/Select-DRMUC3NX.cjs.map +1 -0
- package/dist/chunks/{Select.view-CPMqT8pn.mjs → Select.view-BHMiRNIc.mjs} +126 -124
- package/dist/chunks/Select.view-BHMiRNIc.mjs.map +1 -0
- package/dist/chunks/Select.view-BV01zWHM.cjs +2 -0
- package/dist/chunks/Select.view-BV01zWHM.cjs.map +1 -0
- package/dist/chunks/{Switch-DWx1g3jT.mjs → Switch-04GGHGrV.mjs} +2 -2
- package/dist/chunks/{Switch-DWx1g3jT.mjs.map → Switch-04GGHGrV.mjs.map} +1 -1
- package/dist/chunks/{Switch-D80yPNFV.cjs → Switch-DqgmPp8M.cjs} +2 -2
- package/dist/chunks/{Switch-D80yPNFV.cjs.map → Switch-DqgmPp8M.cjs.map} +1 -1
- package/dist/chunks/Switch.view-6ncV6Ifz.cjs +2 -0
- package/dist/chunks/Switch.view-6ncV6Ifz.cjs.map +1 -0
- package/dist/chunks/{Switch.view-QLZ7O5Z7.mjs → Switch.view-DUvFLhyy.mjs} +34 -39
- package/dist/chunks/Switch.view-DUvFLhyy.mjs.map +1 -0
- package/dist/chunks/Tabs-BdoE88Ee.mjs +567 -0
- package/dist/chunks/Tabs-BdoE88Ee.mjs.map +1 -0
- package/dist/chunks/Tabs-DneEt-le.cjs +2 -0
- package/dist/chunks/Tabs-DneEt-le.cjs.map +1 -0
- package/dist/chunks/{TextField-DOU2CL5J.mjs → TextField-Bwc_F2Rq.mjs} +97 -86
- package/dist/chunks/TextField-Bwc_F2Rq.mjs.map +1 -0
- package/dist/chunks/TextField-CwaxvcqN.cjs +2 -0
- package/dist/chunks/TextField-CwaxvcqN.cjs.map +1 -0
- package/dist/chunks/{default-nRKhMTzF.mjs → default-1F10zins.mjs} +2 -2
- package/dist/chunks/{default-nRKhMTzF.mjs.map → default-1F10zins.mjs.map} +1 -1
- package/dist/chunks/default-W-NMTEJ3.cjs +2 -0
- package/dist/chunks/default-W-NMTEJ3.cjs.map +1 -0
- package/dist/chunks/designSystem.page-BgmjSYsz.cjs +11 -0
- package/dist/chunks/designSystem.page-BgmjSYsz.cjs.map +1 -0
- package/dist/chunks/{designSystem.page-K0ajTvy7.mjs → designSystem.page-CM_h09Ui.mjs} +18 -16
- package/dist/chunks/designSystem.page-CM_h09Ui.mjs.map +1 -0
- package/dist/chunks/{FieldWrapper-Bb0j8Iog.mjs → useFieldDesignSystemProps-BZj7d9gK.mjs} +118 -87
- package/dist/chunks/useFieldDesignSystemProps-BZj7d9gK.mjs.map +1 -0
- package/dist/chunks/useFieldDesignSystemProps-CgVU3R10.cjs +2 -0
- package/dist/chunks/useFieldDesignSystemProps-CgVU3R10.cjs.map +1 -0
- package/dist/design-system-preview.cjs.js +1 -1
- package/dist/design-system-preview.esm.mjs +14 -14
- package/dist/formik.cjs.js +1 -1
- package/dist/formik.esm.mjs +2 -2
- package/dist/link.esm.mjs +1 -1
- package/dist/modal.cjs.js +1 -1
- package/dist/modal.esm.mjs +1 -1
- package/dist/native/components/ActionSheet/ActionSheet/ActionSheet.view.native.js +13 -5
- package/dist/native/components/ActionSheet/ActionSheet/ActionSheet.view.native.js.map +1 -1
- package/dist/native/components/Alert/Alert/Alert.view.d.ts +3 -1
- package/dist/native/components/Alert/Alert/Alert.view.js +16 -6
- package/dist/native/components/Alert/Alert/Alert.view.js.map +1 -1
- package/dist/native/components/Alert/Alert/Alert.view.native.d.ts +3 -1
- package/dist/native/components/Alert/Alert/Alert.view.native.js +15 -4
- package/dist/native/components/Alert/Alert/Alert.view.native.js.map +1 -1
- package/dist/native/components/Alert/Alert.js +3 -3
- package/dist/native/components/Alert/Alert.js.map +1 -1
- package/dist/native/components/Avatar/Avatar/Avatar.props.d.ts +1 -1
- package/dist/native/components/Avatar/Avatar/Avatar.state.d.ts +2 -2
- package/dist/native/components/Avatar/Avatar/Avatar.state.js +6 -5
- package/dist/native/components/Avatar/Avatar/Avatar.state.js.map +1 -1
- package/dist/native/components/Avatar/Avatar/Avatar.view.d.ts +1 -1
- package/dist/native/components/Avatar/Avatar/Avatar.view.js +2 -2
- package/dist/native/components/Avatar/Avatar/Avatar.view.js.map +1 -1
- package/dist/native/components/Avatar/Avatar.js +2 -2
- package/dist/native/components/Avatar/Avatar.js.map +1 -1
- package/dist/native/components/Button/Button/Button.style.js +11 -6
- package/dist/native/components/Button/Button/Button.style.js.map +1 -1
- package/dist/native/components/Button/Button/Button.view.d.ts +2 -0
- package/dist/native/components/Button/Button/Button.view.js +9 -3
- package/dist/native/components/Button/Button/Button.view.js.map +1 -1
- package/dist/native/components/Button/Button/Button.view.native.d.ts +1 -0
- package/dist/native/components/Button/Button/Button.view.native.js +19 -4
- package/dist/native/components/Button/Button/Button.view.native.js.map +1 -1
- package/dist/native/components/Button/Button.core.js +3 -3
- package/dist/native/components/Button/Button.core.js.map +1 -1
- package/dist/native/components/Card/Card/Card.view.d.ts +3 -1
- package/dist/native/components/Card/Card/Card.view.js +32 -24
- package/dist/native/components/Card/Card/Card.view.js.map +1 -1
- package/dist/native/components/Card/Card.js +3 -3
- package/dist/native/components/Card/Card.js.map +1 -1
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.props.d.ts +1 -0
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.state.d.ts +5 -1
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.state.js +13 -0
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.state.js.map +1 -1
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.style.d.ts +3 -12
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.style.js +3 -12
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.style.js.map +1 -1
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.js +19 -16
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.js.map +1 -1
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.native.js +36 -30
- package/dist/native/components/Form/Checkbox/Checkbox/Checkbox.view.native.js.map +1 -1
- package/dist/native/components/Form/Checkbox/Checkbox.js +3 -3
- package/dist/native/components/Form/Checkbox/Checkbox.js.map +1 -1
- package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.state.js +8 -2
- package/dist/native/components/Form/DatePicker/DatePicker/DatePicker.state.js.map +1 -1
- package/dist/native/components/Form/Select/Select/Select.props.d.ts +1 -0
- package/dist/native/components/Form/Select/Select/Select.view.js +2 -2
- package/dist/native/components/Form/Select/Select/Select.view.js.map +1 -1
- package/dist/native/components/Form/Select/Select/Select.view.native.js +17 -4
- package/dist/native/components/Form/Select/Select/Select.view.native.js.map +1 -1
- package/dist/native/components/Form/Select/Select.js +3 -3
- package/dist/native/components/Form/Select/Select.js.map +1 -1
- package/dist/native/components/Form/Switch/Switch/Switch.style.d.ts +3 -8
- package/dist/native/components/Form/Switch/Switch/Switch.style.js +3 -8
- package/dist/native/components/Form/Switch/Switch/Switch.style.js.map +1 -1
- package/dist/native/components/Form/Switch/Switch/Switch.view.js +1 -5
- package/dist/native/components/Form/Switch/Switch/Switch.view.js.map +1 -1
- package/dist/native/components/Form/Switch/Switch/Switch.view.native.js +7 -4
- package/dist/native/components/Form/Switch/Switch/Switch.view.native.js.map +1 -1
- package/dist/native/components/Form/TextField/TextField/TextField.props.d.ts +1 -0
- package/dist/native/components/Form/TextField/TextField/TextField.view.js +2 -2
- package/dist/native/components/Form/TextField/TextField/TextField.view.js.map +1 -1
- package/dist/native/components/Form/TextField/TextField/TextField.view.native.js +9 -4
- package/dist/native/components/Form/TextField/TextField/TextField.view.native.js.map +1 -1
- package/dist/native/components/Form/TextField/TextField.js +3 -3
- package/dist/native/components/Form/TextField/TextField.js.map +1 -1
- package/dist/native/components/Input/FieldContent/FieldContent/FieldContent.props.d.ts +1 -0
- package/dist/native/components/Input/FieldContent/FieldContent.js +16 -3
- package/dist/native/components/Input/FieldContent/FieldContent.js.map +1 -1
- package/dist/native/components/Input/useFieldDesignSystemProps.d.ts +9 -0
- package/dist/native/components/Input/useFieldDesignSystemProps.js +15 -0
- package/dist/native/components/Input/useFieldDesignSystemProps.js.map +1 -0
- package/dist/native/components/Modal/Modal/Modal.props.d.ts +2 -0
- package/dist/native/components/Modal/Modal/Modal.view.js +6 -4
- package/dist/native/components/Modal/Modal/Modal.view.js.map +1 -1
- package/dist/native/components/Modal/Modal/Modal.view.native.js +5 -4
- package/dist/native/components/Modal/Modal/Modal.view.native.js.map +1 -1
- package/dist/native/components/Tabs/Tabs/TabHeader.d.ts +2 -0
- package/dist/native/components/Tabs/Tabs/TabHeader.js +7 -6
- package/dist/native/components/Tabs/Tabs/TabHeader.js.map +1 -1
- package/dist/native/components/Tabs/Tabs/Tabs.props.d.ts +10 -0
- package/dist/native/components/Tabs/Tabs/Tabs.state.d.ts +1 -0
- package/dist/native/components/Tabs/Tabs/Tabs.state.js +20 -43
- package/dist/native/components/Tabs/Tabs/Tabs.state.js.map +1 -1
- package/dist/native/components/Tabs/Tabs/Tabs.styles.d.ts +11 -0
- package/dist/native/components/Tabs/Tabs/Tabs.styles.js +7 -0
- package/dist/native/components/Tabs/Tabs/Tabs.styles.js.map +1 -0
- package/dist/native/components/Tabs/Tabs/Tabs.type.d.ts +4 -0
- package/dist/native/components/Tabs/Tabs/Tabs.view.js +146 -58
- package/dist/native/components/Tabs/Tabs/Tabs.view.js.map +1 -1
- package/dist/native/components/Tabs/Tabs/Tabs.view.native.js +83 -19
- package/dist/native/components/Tabs/Tabs/Tabs.view.native.js.map +1 -1
- package/dist/native/components/Tabs/Tabs.js +8 -8
- package/dist/native/components/Tabs/Tabs.js.map +1 -1
- package/dist/native/components/index.js +1 -1
- package/dist/native/components/index.js.map +1 -1
- package/dist/native/components/pilot/blocks/SettingsPanel.js +3 -1
- package/dist/native/components/pilot/blocks/SettingsPanel.js.map +1 -1
- package/dist/native/components/pilot/blocks/SignIn.js +3 -1
- package/dist/native/components/pilot/blocks/SignIn.js.map +1 -1
- package/dist/native/design-system/DesignSystemProvider.d.ts +1 -1
- package/dist/native/design-system/DesignSystemProvider.js +2 -2
- package/dist/native/design-system/DesignSystemProvider.js.map +1 -1
- package/dist/native/design-system/configs/default.json +1 -1
- package/dist/native/design-system/theme.d.ts +10 -1
- package/dist/native/design-system/theme.js +41 -12
- package/dist/native/design-system/theme.js.map +1 -1
- package/dist/native/design-system/types.d.ts +3 -9
- package/dist/native/design-system/utils.d.ts +5 -2
- package/dist/native/design-system/utils.js +42 -10
- package/dist/native/design-system/utils.js.map +1 -1
- package/dist/presets.cjs.js +1 -1
- package/dist/presets.esm.mjs +1 -1
- package/dist/registry/alert.json +13 -12
- package/dist/registry/avatar.json +15 -15
- package/dist/registry/button.json +14 -12
- package/dist/registry/card.json +13 -13
- package/dist/registry/checkbox.json +14 -11
- package/dist/registry/modal.json +8 -4
- package/dist/registry/registry.json +178 -78
- package/dist/registry/select.json +20 -12
- package/dist/registry/settings-panel.json +6 -2
- package/dist/registry/sign-in.json +6 -2
- package/dist/registry/switch.json +15 -15
- package/dist/registry/tabs.json +23 -18
- package/dist/registry/text-field.json +19 -11
- package/dist/registry/theme.json +71 -0
- package/dist/select.cjs.js +1 -1
- package/dist/select.esm.mjs +1 -1
- package/dist/settings-panel.cjs.js +1 -1
- package/dist/settings-panel.cjs.js.map +1 -1
- package/dist/settings-panel.esm.mjs +9 -9
- package/dist/settings-panel.esm.mjs.map +1 -1
- package/dist/sign-in.cjs.js +1 -1
- package/dist/sign-in.cjs.js.map +1 -1
- package/dist/sign-in.esm.mjs +15 -15
- package/dist/sign-in.esm.mjs.map +1 -1
- package/dist/switch.cjs.js +1 -1
- package/dist/switch.esm.mjs +1 -1
- package/dist/tabs.cjs.js +1 -1
- package/dist/tabs.esm.mjs +1 -1
- package/dist/text-field.cjs.js +1 -1
- package/dist/text-field.esm.mjs +1 -1
- package/dist/theme.cjs.js +1 -1
- package/dist/theme.cjs.js.map +1 -1
- package/dist/theme.esm.mjs +125 -72
- package/dist/theme.esm.mjs.map +1 -1
- package/dist/types/components/Alert/Alert/Alert.view.d.ts +3 -1
- package/dist/types/components/Avatar/Avatar/Avatar.props.d.ts +1 -1
- package/dist/types/components/Avatar/Avatar/Avatar.state.d.ts +2 -2
- package/dist/types/components/Avatar/Avatar/Avatar.view.d.ts +1 -1
- package/dist/types/components/Button/Button/Button.view.d.ts +2 -0
- package/dist/types/components/Card/Card/Card.view.d.ts +3 -1
- package/dist/types/components/Form/Checkbox/Checkbox/Checkbox.props.d.ts +1 -0
- package/dist/types/components/Form/Checkbox/Checkbox/Checkbox.state.d.ts +5 -1
- package/dist/types/components/Form/Checkbox/Checkbox/Checkbox.style.d.ts +3 -12
- package/dist/types/components/Form/Select/Select/Select.props.d.ts +1 -0
- package/dist/types/components/Form/Switch/Switch/Switch.style.d.ts +3 -8
- package/dist/types/components/Form/TextField/TextField/TextField.props.d.ts +1 -0
- package/dist/types/components/IconPicker/IconPicker/IconPicker.state.d.ts +2 -2
- package/dist/types/components/Input/FieldContent/FieldContent/FieldContent.props.d.ts +1 -0
- package/dist/types/components/Input/useFieldDesignSystemProps.d.ts +9 -0
- package/dist/types/components/Modal/Modal/Modal.props.d.ts +2 -0
- package/dist/types/components/Tabs/Tabs/TabHeader.d.ts +2 -0
- package/dist/types/components/Tabs/Tabs/Tabs.props.d.ts +10 -0
- package/dist/types/components/Tabs/Tabs/Tabs.state.d.ts +1 -0
- package/dist/types/components/Tabs/Tabs/Tabs.styles.d.ts +11 -0
- package/dist/types/components/Tabs/Tabs/Tabs.type.d.ts +4 -0
- package/dist/types/design-system/DesignSystemProvider.d.ts +1 -1
- package/dist/types/design-system/configs/default.json.d.ts +1 -1
- package/dist/types/design-system/theme.d.ts +10 -1
- package/dist/types/design-system/types.d.ts +3 -9
- package/dist/types/design-system/utils.d.ts +5 -2
- package/dist/web.cjs.js +16 -16
- package/dist/web.esm.mjs +44 -41
- package/dist/web.umd.js +38 -38
- package/dist/web.umd.js.map +1 -1
- package/docs/getting-started/react-native.md +17 -3
- package/docs/guides/performance.mdx +5 -0
- package/docs/guides/react-native.mdx +10 -0
- package/docs/guides/registry-guide.mdx +72 -8
- package/package.json +6 -4
- package/dist/chunks/Alert-Bjl40k3x.cjs +0 -2
- package/dist/chunks/Alert-Bjl40k3x.cjs.map +0 -1
- package/dist/chunks/Alert-Q1HlVX8f.mjs.map +0 -1
- package/dist/chunks/AttachmentPreview-8d8gZ5kk.mjs.map +0 -1
- package/dist/chunks/AttachmentPreview-Bwrz5TJh.cjs +0 -2
- package/dist/chunks/AttachmentPreview-Bwrz5TJh.cjs.map +0 -1
- package/dist/chunks/Avatar-BB0DeN9j.cjs +0 -2
- package/dist/chunks/Avatar-BB0DeN9j.cjs.map +0 -1
- package/dist/chunks/Avatar-D-GkyL2c.mjs.map +0 -1
- package/dist/chunks/Button.core-Bc5cSn_z.mjs.map +0 -1
- package/dist/chunks/Button.core-BhtOm8ak.cjs +0 -7
- package/dist/chunks/Button.core-BhtOm8ak.cjs.map +0 -1
- package/dist/chunks/Button.pilot-C4BIb08S.mjs +0 -6
- package/dist/chunks/Button.pilot-JmR2DCSE.cjs +0 -2
- package/dist/chunks/Card-CNSl9fD5.cjs +0 -2
- package/dist/chunks/Card-CNSl9fD5.cjs.map +0 -1
- package/dist/chunks/Card-DMhV_NTt.mjs +0 -200
- package/dist/chunks/Card-DMhV_NTt.mjs.map +0 -1
- package/dist/chunks/Checkbox-Bo7IRVRE.mjs +0 -11
- package/dist/chunks/Checkbox-Bo7IRVRE.mjs.map +0 -1
- package/dist/chunks/Checkbox-CAI6RtuO.cjs +0 -2
- package/dist/chunks/Checkbox-CAI6RtuO.cjs.map +0 -1
- package/dist/chunks/Checkbox.view-DGdNPlF9.cjs +0 -2
- package/dist/chunks/Checkbox.view-DGdNPlF9.cjs.map +0 -1
- package/dist/chunks/Checkbox.view-dhc-rfEX.mjs.map +0 -1
- package/dist/chunks/FieldWrapper-Bb0j8Iog.mjs.map +0 -1
- package/dist/chunks/FieldWrapper-DRCn7BLi.cjs +0 -2
- package/dist/chunks/FieldWrapper-DRCn7BLi.cjs.map +0 -1
- package/dist/chunks/Modal-DkckCT8-.mjs.map +0 -1
- package/dist/chunks/Modal-zok954As.cjs +0 -2
- package/dist/chunks/Modal-zok954As.cjs.map +0 -1
- package/dist/chunks/Select-C6R0Tei-.cjs +0 -2
- package/dist/chunks/Select-C6R0Tei-.cjs.map +0 -1
- package/dist/chunks/Select-C7IBNyjR.mjs +0 -24
- package/dist/chunks/Select-C7IBNyjR.mjs.map +0 -1
- package/dist/chunks/Select.view-CPMqT8pn.mjs.map +0 -1
- package/dist/chunks/Select.view-Pq1yAcMm.cjs +0 -2
- package/dist/chunks/Select.view-Pq1yAcMm.cjs.map +0 -1
- package/dist/chunks/Switch.view-CQZO_Js7.cjs +0 -2
- package/dist/chunks/Switch.view-CQZO_Js7.cjs.map +0 -1
- package/dist/chunks/Switch.view-QLZ7O5Z7.mjs.map +0 -1
- package/dist/chunks/Tabs-D5chMrkE.mjs +0 -403
- package/dist/chunks/Tabs-D5chMrkE.mjs.map +0 -1
- package/dist/chunks/Tabs-DQeBJwkz.cjs +0 -2
- package/dist/chunks/Tabs-DQeBJwkz.cjs.map +0 -1
- package/dist/chunks/TextField-DOU2CL5J.mjs.map +0 -1
- package/dist/chunks/TextField-Da4JCcAU.cjs +0 -2
- package/dist/chunks/TextField-Da4JCcAU.cjs.map +0 -1
- package/dist/chunks/default-D7ePSMKP.cjs +0 -2
- package/dist/chunks/default-D7ePSMKP.cjs.map +0 -1
- package/dist/chunks/designSystem.page-B74Vm2Dt.cjs +0 -11
- package/dist/chunks/designSystem.page-B74Vm2Dt.cjs.map +0 -1
- package/dist/chunks/designSystem.page-K0ajTvy7.mjs.map +0 -1
|
@@ -7,12 +7,18 @@
|
|
|
7
7
|
"categories": [
|
|
8
8
|
"Forms"
|
|
9
9
|
],
|
|
10
|
-
"registryDependencies": [
|
|
10
|
+
"registryDependencies": [
|
|
11
|
+
"theme"
|
|
12
|
+
],
|
|
11
13
|
"meta": {
|
|
12
14
|
"appStudio": {
|
|
13
15
|
"entry": "src/components/pilot/text-field.ts",
|
|
14
16
|
"engine": ">=0.9.5",
|
|
15
|
-
"
|
|
17
|
+
"engineByPlatform": {
|
|
18
|
+
"ios": ">=0.10.0",
|
|
19
|
+
"android": ">=0.10.0"
|
|
20
|
+
},
|
|
21
|
+
"version": "0.12.1",
|
|
16
22
|
"license": "MIT",
|
|
17
23
|
"platforms": [
|
|
18
24
|
"web",
|
|
@@ -21,15 +27,12 @@
|
|
|
21
27
|
],
|
|
22
28
|
"dependencies": {
|
|
23
29
|
"web": [
|
|
24
|
-
"@app-studio/components@0.11.13",
|
|
25
30
|
"lucide-react@^0.562.0"
|
|
26
31
|
],
|
|
27
32
|
"ios": [
|
|
28
|
-
"@app-studio/components@0.11.13",
|
|
29
33
|
"react-native-svg@>= 13"
|
|
30
34
|
],
|
|
31
35
|
"android": [
|
|
32
|
-
"@app-studio/components@0.11.13",
|
|
33
36
|
"react-native-svg@>= 13"
|
|
34
37
|
]
|
|
35
38
|
},
|
|
@@ -74,12 +77,12 @@
|
|
|
74
77
|
},
|
|
75
78
|
{
|
|
76
79
|
"path": "src/components/Form/TextField/TextField.tsx",
|
|
77
|
-
"content": "import React from 'react';\nimport { TextFieldProps } from './TextField/TextField.props';\nimport { useTextFieldState } from './TextField/TextField.state';\nimport TextFieldView from './TextField/TextField.view';\nimport {
|
|
80
|
+
"content": "import React from 'react';\nimport { TextFieldProps } from './TextField/TextField.props';\nimport { useTextFieldState } from './TextField/TextField.state';\nimport TextFieldView from './TextField/TextField.view';\nimport { useFieldDesignSystemProps } from '../../Input/useFieldDesignSystemProps';\nconst TextFieldComponent: React.FC<TextFieldProps> = (\n props: TextFieldProps\n) => {\n const { props: mergedProps, themeContainer } = useFieldDesignSystemProps(\n 'input',\n props\n );\n // Initializes the 'textFieldStates' with state-management logic and relevant properties from 'useTextFieldState' hook, passing current 'props' as the argument\n const textFieldStates = useTextFieldState(mergedProps);\n // Renders the 'TextFieldView' component with the spread attributes from both 'textFieldStates' and 'props' to pass all necessary data\n return (\n <TextFieldView\n {...textFieldStates}\n {...mergedProps}\n themeContainer={themeContainer}\n />\n );\n};\n// Exports 'TextFieldComponent' as 'TextField' for use in other parts of the application\nexport const TextField = TextFieldComponent;\n",
|
|
78
81
|
"type": "registry:ui"
|
|
79
82
|
},
|
|
80
83
|
{
|
|
81
84
|
"path": "src/components/Form/TextField/TextField/TextField.props.ts",
|
|
82
|
-
"content": "import React from 'react';\nimport { InputProps, Shadow, ViewProps } from 'app-studio';\nimport { Elevation } from '../../../../utils/elevation';\nimport { Shape, Size, TextFieldStyles, Variant } from './TextField.type';\n// The TextFieldProps interface extends InputProps and customizes the TextField\n// component. `onChange` is omitted from InputProps (where it is the DOM\n// FormEventHandler) because TextField re-declares it with value-first\n// semantics — see the prop's own doc comment below.\nexport interface TextFieldProps\n extends Omit<InputProps, 'size' | 'shadow' | 'left' | 'right' | 'onChange'> {\n // Optional unique identifier for the TextField.\n id?: string;\n // Optional property for error handling within the TextField.\n error?: any;\n // Optional helper text that appears below the TextField.\n helperText?: string;\n // Optional name attribute for the TextField, useful for form submission.\n name?: string;\n // Optional label text for the TextField to indicate the field's purpose.\n label?: string;\n // Optional React node to be rendered on the left side of the TextField.\n left?: React.ReactNode;\n // Optional React node to be rendered on the right side of the TextField.\n right?: React.ReactNode;\n // Optional placeholder text shown inside the TextField when empty.\n placeholder?: string;\n // Optional flag to set the TextField as read-only.\n isReadOnly?: boolean;\n // Optional flag to indicate whether the TextField is disabled.\n isDisabled?: boolean;\n // Optional flag that when true allows the TextField to be cleared.\n isClearable?: boolean;\n // Optional flag to autofocus the TextField when it mounts.\n isAutoFocus?: boolean;\n // Optional flag indicating the field is required for form submission.\n isRequired?: boolean;\n // Optional flag indicating the field is required (HTML attribute alias).\n required?: boolean;\n // Optional adornment rendered at the right edge of the field.\n rightIcon?: React.ReactNode;\n // Optional adornment rendered at the left edge of the field.\n leftIcon?: React.ReactNode;\n // Optional ViewProps applied to the field's label element.\n labelProps?: any;\n /**\n * Called when the value changes, with the **value itself** — not the DOM\n * event. TextField follows the value-first convention this package already\n * exposes through `onChangeText`, so there is no `event.target` to read:\n *\n * onChange={(value) => setQuery(value)} // ✅\n * onChange={(e) => setQuery(e.target.value)} // ❌ compile error\n *\n * The parameter is deliberately typed `string` rather than `any`: a\n * DOM-shaped handler is an API mistake, and typing it makes that mistake a\n * compile error instead of an input that silently never updates. If you\n * need the event, use `onChangeText` for the value and reach for the native\n * `<input>` through `inputRef`.\n */\n onChange?: (value: string) => void;\n // Optional callback function that is called when the text in the TextField changes.\n onChangeText?: (value: string) => void;\n /**\n * Called when the field loses focus, with the blur **event** (not the\n * value). Clearing the field via the clear button synthesises a minimal\n * `{ target: { name } }` so form libraries can mark the field touched.\n */\n onBlur?: (event: any) => void;\n // Optional callback function that is called when the TextField is clicked.\n onClick?: () => void;\n // Optional callback function that is called when the TextField gains focus.\n onFocus?: () => void;\n // Optional Size enum to specify the size of the TextField.\n size?: Size;\n // Optional shadow property that could be of type Shadow, Elevation, or CSSProperties to give depth effect.\n shadow?: Shadow | Elevation | ViewProps;\n // Optional Shape enum to specify the shape of the TextField's corners.\n shape?: Shape;\n // Optional custom styles to apply to the TextField component.\n views?: TextFieldStyles;\n // Optional controlled value of the TextField, driving its current state.\n value?: string;\n // Optional Variant enum to specify the variant of the TextField component.\n variant?: Variant;\n // Optional flag to render the field as a multiline input (a <textarea> on\n // web, a multiline TextInput on native).\n isMultiline?: boolean;\n // Alias of `isMultiline`.\n multiline?: boolean;\n // Optional number of rows when rendered in multiline mode.\n rows?: number;\n // Optional callback ref to the underlying input node. Used by the Formik\n // focus chain (FormikForm autoFocus) to register the field so Return/Next\n // can move focus to it. A plain prop (not React `ref`) so non-text fields\n // that ignore it stay wireable without ref warnings.\n inputRef?: (node: { focus: () => void } | null) => void;\n}\n// The TextFieldViewProps interface extends TextFieldProps and adds props specific to the view-layer customization of the component.\nexport interface TextFieldViewProps extends TextFieldProps {\n // Optional property to give hints to the user about how to fill in the TextField.\n hint?: string;\n // Optional function that allows changing the hint text.\n setHint?: (hint?: string) => void;\n // Optional property indicating whether the TextField is currently focused.\n isFocused?: boolean;\n // Optional function to update the focused state of the TextField.\n setIsFocused?: (focused: boolean) => void;\n // Optional property indicating whether the TextField is currently hovered by the mouse cursor.\n isHovered?: boolean;\n // Optional function to update the hovered state of the TextField.\n setIsHovered?: (hovered: boolean) => void;\n // Optional controlled value of the TextField, potentially used in a state management context.\n value?: string;\n // Optional function to programmatically set the value of the TextField.\n setValue?: (value: string) => void;\n // Theme mode override (light/dark).\n}\n",
|
|
85
|
+
"content": "import React from 'react';\nimport { InputProps, Shadow, ViewProps } from 'app-studio';\nimport { Elevation } from '../../../../utils/elevation';\nimport { Shape, Size, TextFieldStyles, Variant } from './TextField.type';\n// The TextFieldProps interface extends InputProps and customizes the TextField\n// component. `onChange` is omitted from InputProps (where it is the DOM\n// FormEventHandler) because TextField re-declares it with value-first\n// semantics — see the prop's own doc comment below.\nexport interface TextFieldProps\n extends Omit<InputProps, 'size' | 'shadow' | 'left' | 'right' | 'onChange'> {\n // Optional unique identifier for the TextField.\n id?: string;\n // Optional property for error handling within the TextField.\n error?: any;\n // Optional helper text that appears below the TextField.\n helperText?: string;\n // Optional name attribute for the TextField, useful for form submission.\n name?: string;\n // Optional label text for the TextField to indicate the field's purpose.\n label?: string;\n // Optional React node to be rendered on the left side of the TextField.\n left?: React.ReactNode;\n // Optional React node to be rendered on the right side of the TextField.\n right?: React.ReactNode;\n // Optional placeholder text shown inside the TextField when empty.\n placeholder?: string;\n // Optional flag to set the TextField as read-only.\n isReadOnly?: boolean;\n // Optional flag to indicate whether the TextField is disabled.\n isDisabled?: boolean;\n // Optional flag that when true allows the TextField to be cleared.\n isClearable?: boolean;\n // Optional flag to autofocus the TextField when it mounts.\n isAutoFocus?: boolean;\n // Optional flag indicating the field is required for form submission.\n isRequired?: boolean;\n // Optional flag indicating the field is required (HTML attribute alias).\n required?: boolean;\n // Optional adornment rendered at the right edge of the field.\n rightIcon?: React.ReactNode;\n // Optional adornment rendered at the left edge of the field.\n leftIcon?: React.ReactNode;\n // Optional ViewProps applied to the field's label element.\n labelProps?: any;\n /**\n * Called when the value changes, with the **value itself** — not the DOM\n * event. TextField follows the value-first convention this package already\n * exposes through `onChangeText`, so there is no `event.target` to read:\n *\n * onChange={(value) => setQuery(value)} // ✅\n * onChange={(e) => setQuery(e.target.value)} // ❌ compile error\n *\n * The parameter is deliberately typed `string` rather than `any`: a\n * DOM-shaped handler is an API mistake, and typing it makes that mistake a\n * compile error instead of an input that silently never updates. If you\n * need the event, use `onChangeText` for the value and reach for the native\n * `<input>` through `inputRef`.\n */\n onChange?: (value: string) => void;\n // Optional callback function that is called when the text in the TextField changes.\n onChangeText?: (value: string) => void;\n /**\n * Called when the field loses focus, with the blur **event** (not the\n * value). Clearing the field via the clear button synthesises a minimal\n * `{ target: { name } }` so form libraries can mark the field touched.\n */\n onBlur?: (event: any) => void;\n // Optional callback function that is called when the TextField is clicked.\n onClick?: () => void;\n // Optional callback function that is called when the TextField gains focus.\n onFocus?: () => void;\n // Optional Size enum to specify the size of the TextField.\n size?: Size;\n // Optional shadow property that could be of type Shadow, Elevation, or CSSProperties to give depth effect.\n shadow?: Shadow | Elevation | ViewProps;\n // Optional Shape enum to specify the shape of the TextField's corners.\n shape?: Shape;\n // Optional custom styles to apply to the TextField component.\n views?: TextFieldStyles;\n // Optional controlled value of the TextField, driving its current state.\n value?: string;\n // Optional Variant enum to specify the variant of the TextField component.\n variant?: Variant;\n // Optional flag to render the field as a multiline input (a <textarea> on\n // web, a multiline TextInput on native).\n isMultiline?: boolean;\n // Alias of `isMultiline`.\n multiline?: boolean;\n // Optional number of rows when rendered in multiline mode.\n rows?: number;\n // Optional callback ref to the underlying input node. Used by the Formik\n // focus chain (FormikForm autoFocus) to register the field so Return/Next\n // can move focus to it. A plain prop (not React `ref`) so non-text fields\n // that ignore it stay wireable without ref warnings.\n inputRef?: (node: { focus: () => void } | null) => void;\n}\n// The TextFieldViewProps interface extends TextFieldProps and adds props specific to the view-layer customization of the component.\nexport interface TextFieldViewProps extends TextFieldProps {\n themeContainer?: ViewProps;\n // Optional property to give hints to the user about how to fill in the TextField.\n hint?: string;\n // Optional function that allows changing the hint text.\n setHint?: (hint?: string) => void;\n // Optional property indicating whether the TextField is currently focused.\n isFocused?: boolean;\n // Optional function to update the focused state of the TextField.\n setIsFocused?: (focused: boolean) => void;\n // Optional property indicating whether the TextField is currently hovered by the mouse cursor.\n isHovered?: boolean;\n // Optional function to update the hovered state of the TextField.\n setIsHovered?: (hovered: boolean) => void;\n // Optional controlled value of the TextField, potentially used in a state management context.\n value?: string;\n // Optional function to programmatically set the value of the TextField.\n setValue?: (value: string) => void;\n // Theme mode override (light/dark).\n}\n",
|
|
83
86
|
"type": "registry:ui"
|
|
84
87
|
},
|
|
85
88
|
{
|
|
@@ -94,12 +97,12 @@
|
|
|
94
97
|
},
|
|
95
98
|
{
|
|
96
99
|
"path": "src/components/Form/TextField/TextField/TextField.view.native.tsx",
|
|
97
|
-
"content": "/**\n * TextField View Component (React Native)\n *\n * React Native counterpart of TextField.view.tsx. Uses app-studio's <Input/>\n * which maps to RN <TextInput/>. Drops web-only CSS (cursor, _hover, transition,\n * boxShadow, outline, autofill) and relies on the native focus indicator.\n *\n * NOTE: Password.tsx delegates to this view passing `type` (\"text\" | \"password\").\n * We translate that into `secureTextEntry` here so Password works for free.\n */\n\nimport React from 'react';\nimport { Input, useTheme, View } from 'app-studio';\nimport { FieldContainer } from '../../../Input/FieldContainer/FieldContainer';\nimport { FieldContent } from '../../../Input/FieldContent/FieldContent';\nimport { FieldIcons } from '../../../Input/FieldIcons/FieldIcons';\nimport { FieldLabel } from '../../../Input/FieldLabel/FieldLabel';\nimport { FieldWrapper } from '../../../Input/FieldWrapper/FieldWrapper';\nimport { CloseIcon } from '../../../Icon/FixedIcons';\nimport { TextFieldViewProps } from './TextField.props';\n\nconst TextFieldView: React.FC<TextFieldViewProps> = ({\n id,\n name,\n label,\n hint,\n value,\n onChange,\n left,\n right,\n helperText,\n placeholder,\n onChangeText,\n shadow = {},\n views = { container: {}, field: {}, label: {}, helperText: {}, text: {} },\n size = 'md',\n shape = 'default',\n variant = 'default',\n error = false,\n isFocused = false,\n isHovered = false,\n isDisabled = false,\n isReadOnly = false,\n isClearable = true,\n isAutoFocus = false,\n isMultiline,\n multiline,\n rows,\n setHint = () => {},\n setIsFocused = () => {},\n setIsHovered = () => {},\n setValue = () => {},\n onClick = () => {},\n onFocus,\n onBlur = () => {},\n themeMode: elementMode,\n ...props\n}) => {\n const { getColor } = useTheme();\n const IconColor = getColor(isDisabled ? 'color-gray-400' : 'color-gray-500');\n const showLabel = !!label;\n const isTextArea = isMultiline ?? multiline ?? false;\n\n const fieldSizeStyles = {\n xs: { minHeight: 24, shellPaddingY: 6, shellPaddingX: 10, fontSize: 12 },\n sm: { minHeight: 32, shellPaddingY: 8, shellPaddingX: 10, fontSize: 12 },\n md: { minHeight: 40, shellPaddingY: 10, shellPaddingX: 12, fontSize: 14 },\n lg: { minHeight: 48, shellPaddingY: 12, shellPaddingX: 14, fontSize: 16 },\n xl: { minHeight: 56, shellPaddingY: 14, shellPaddingX: 16, fontSize: 18 },\n } as const;\n\n const fieldView = views?.field || {};\n const fieldStyles = {\n margin: 0,\n paddingVertical: 0,\n paddingHorizontal: 0,\n width: '100%',\n minHeight: undefined,\n borderWidth: 0,\n backgroundColor: 'transparent',\n fontSize: fieldSizeStyles[size].fontSize,\n fontWeight: '400' as const,\n color: isDisabled ? 'color-gray-400' : 'color-gray-900',\n opacity: isDisabled ? 0.7 : 1,\n ...fieldView,\n };\n\n // Translate Password's `type=\"password\"` into RN's secureTextEntry.\n // `type` itself is meaningless on a TextInput.\n const typeProp = (props as any).type;\n const secureTextEntry = typeProp === 'password';\n const {\n type: _ignoreType,\n autoComplete: _ignoreAutoComplete,\n ...restProps\n } = props as any;\n\n const handleFocus = () => {\n setIsFocused(true);\n if (onFocus) onFocus();\n };\n const handleBlur = (event: any) => {\n if (onBlur) onBlur(event);\n setIsFocused(false);\n };\n const handleChangeText = (text: string) => {\n setValue(text);\n if (onChangeText) onChangeText(text);\n if (onChange) onChange(text);\n };\n const handleClear = () => {\n setValue('');\n if (onChange) onChange('');\n if (onChangeText) onChangeText('');\n if (onBlur) onBlur({ target: { name } });\n };\n\n const {\n container: _shellContainer,\n content: _shellContent,\n ...layoutViews\n } = views || {};\n\n return (\n <FieldContainer helperText={helperText} error={error} views={layoutViews}>\n <FieldContent\n label={label}\n size={size}\n error={error}\n shape={shape}\n views={views}\n shadow={shadow}\n variant={variant}\n value={value}\n color={'theme-primary'}\n isHovered={isHovered}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isFocused={isFocused}\n showLabel={showLabel}\n minHeight={fieldSizeStyles[size].minHeight}\n paddingTop={fieldSizeStyles[size].shellPaddingY}\n paddingBottom={fieldSizeStyles[size].shellPaddingY}\n paddingLeft={fieldSizeStyles[size].shellPaddingX}\n paddingRight={fieldSizeStyles[size].shellPaddingX}\n >\n {left}\n <FieldWrapper>\n {showLabel && (\n <FieldLabel
|
|
100
|
+
"content": "/**\n * TextField View Component (React Native)\n *\n * React Native counterpart of TextField.view.tsx. Uses app-studio's <Input/>\n * which maps to RN <TextInput/>. Drops web-only CSS (cursor, _hover, transition,\n * boxShadow, outline, autofill) and relies on the native focus indicator.\n *\n * NOTE: Password.tsx delegates to this view passing `type` (\"text\" | \"password\").\n * We translate that into `secureTextEntry` here so Password works for free.\n */\n\nimport React from 'react';\nimport { Input, useTheme, View } from 'app-studio';\nimport { FieldContainer } from '../../../Input/FieldContainer/FieldContainer';\nimport { FieldContent } from '../../../Input/FieldContent/FieldContent';\nimport { FieldIcons } from '../../../Input/FieldIcons/FieldIcons';\nimport { FieldLabel } from '../../../Input/FieldLabel/FieldLabel';\nimport { FieldWrapper } from '../../../Input/FieldWrapper/FieldWrapper';\nimport { CloseIcon } from '../../../Icon/FixedIcons';\nimport { TextFieldViewProps } from './TextField.props';\n\nconst TextFieldView: React.FC<TextFieldViewProps> = ({\n id,\n name,\n label,\n hint,\n value,\n onChange,\n left,\n right,\n helperText,\n placeholder,\n onChangeText,\n shadow = {},\n views = { container: {}, field: {}, label: {}, helperText: {}, text: {} },\n themeContainer,\n size = 'md',\n shape = 'default',\n variant = 'default',\n error = false,\n isFocused = false,\n isHovered = false,\n isDisabled = false,\n isReadOnly = false,\n isClearable = true,\n isAutoFocus = false,\n isMultiline,\n multiline,\n rows,\n setHint = () => {},\n setIsFocused = () => {},\n setIsHovered = () => {},\n setValue = () => {},\n onClick = () => {},\n onFocus,\n onBlur = () => {},\n themeMode: elementMode,\n ...props\n}) => {\n const { getColor } = useTheme();\n const IconColor = getColor(isDisabled ? 'color-gray-400' : 'color-gray-500');\n const showLabel = !!label;\n const isTextArea = isMultiline ?? multiline ?? false;\n\n const fieldSizeStyles = {\n xs: { minHeight: 24, shellPaddingY: 6, shellPaddingX: 10, fontSize: 12 },\n sm: { minHeight: 32, shellPaddingY: 8, shellPaddingX: 10, fontSize: 12 },\n md: { minHeight: 40, shellPaddingY: 10, shellPaddingX: 12, fontSize: 14 },\n lg: { minHeight: 48, shellPaddingY: 12, shellPaddingX: 14, fontSize: 16 },\n xl: { minHeight: 56, shellPaddingY: 14, shellPaddingX: 16, fontSize: 18 },\n } as const;\n\n const fieldView = views?.field || {};\n const fieldStyles = {\n margin: 0,\n paddingVertical: 0,\n paddingHorizontal: 0,\n width: '100%',\n minHeight: undefined,\n borderWidth: 0,\n backgroundColor: 'transparent',\n fontSize: fieldSizeStyles[size].fontSize,\n fontWeight: '400' as const,\n color: isDisabled ? 'color-gray-400' : 'color-gray-900',\n opacity: isDisabled ? 0.7 : 1,\n ...fieldView,\n };\n\n // Translate Password's `type=\"password\"` into RN's secureTextEntry.\n // `type` itself is meaningless on a TextInput.\n const typeProp = (props as any).type;\n const secureTextEntry = typeProp === 'password';\n const {\n type: _ignoreType,\n autoComplete: _ignoreAutoComplete,\n ...restProps\n } = props as any;\n\n const handleFocus = () => {\n setIsFocused(true);\n if (onFocus) onFocus();\n };\n const handleBlur = (event: any) => {\n if (onBlur) onBlur(event);\n setIsFocused(false);\n };\n const handleChangeText = (text: string) => {\n setValue(text);\n if (onChangeText) onChangeText(text);\n if (onChange) onChange(text);\n };\n const handleClear = () => {\n setValue('');\n if (onChange) onChange('');\n if (onChangeText) onChangeText('');\n if (onBlur) onBlur({ target: { name } });\n };\n\n const {\n container: _shellContainer,\n content: _shellContent,\n ...layoutViews\n } = views || {};\n\n return (\n <FieldContainer helperText={helperText} error={error} views={layoutViews}>\n <FieldContent\n label={label}\n size={size}\n error={error}\n shape={shape}\n views={views}\n themeContainer={themeContainer}\n shadow={shadow}\n variant={variant}\n value={value}\n color={'theme-primary'}\n isHovered={isHovered}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isFocused={isFocused}\n showLabel={showLabel}\n minHeight={fieldSizeStyles[size].minHeight}\n paddingTop={fieldSizeStyles[size].shellPaddingY}\n paddingBottom={fieldSizeStyles[size].shellPaddingY}\n paddingLeft={fieldSizeStyles[size].shellPaddingX}\n paddingRight={fieldSizeStyles[size].shellPaddingX}\n >\n {left}\n <FieldWrapper>\n {showLabel && (\n <FieldLabel\n error={error}\n views={{\n label: {\n color: error ? 'theme-error' : 'theme-text',\n ...views?.label,\n },\n }}\n >\n {label}\n </FieldLabel>\n )}\n <Input\n id={id}\n name={name}\n editable={!isReadOnly && !isDisabled}\n autoFocus={isAutoFocus}\n placeholder={placeholder || hint}\n placeholderTextColor={getColor('color-gray-400')}\n keyboardType={typeProp === 'email' ? 'email-address' : undefined}\n secureTextEntry={secureTextEntry}\n accessibilityLabel={label}\n accessibilityHint={\n error && error !== true ? String(error) : undefined\n }\n multiline={isTextArea}\n numberOfLines={isTextArea ? rows : undefined}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChangeText={handleChangeText}\n value={value as any}\n {...fieldStyles}\n {...restProps}\n />\n </FieldWrapper>\n {isClearable && Boolean(value) && !isReadOnly && !isDisabled && (\n <FieldIcons>\n <View onPress={handleClear}>\n <CloseIcon size={20} color={IconColor} borderRadius={9999} />\n </View>\n </FieldIcons>\n )}\n {right}\n </FieldContent>\n </FieldContainer>\n );\n};\n\nexport default TextFieldView;\n",
|
|
98
101
|
"type": "registry:ui"
|
|
99
102
|
},
|
|
100
103
|
{
|
|
101
104
|
"path": "src/components/Form/TextField/TextField/TextField.view.tsx",
|
|
102
|
-
"content": "/**\n * TextField View Component\n *\n * Renders a text input field with various styles and states\n * according to the design guidelines.\n */\n\nimport React from 'react';\nimport { Input, useTheme } from 'app-studio';\nimport { FieldContainer } from '../../../Input/FieldContainer/FieldContainer';\nimport { FieldContent } from '../../../Input/FieldContent/FieldContent';\nimport { FieldIcons } from '../../../Input/FieldIcons/FieldIcons';\nimport { FieldLabel } from '../../../Input/FieldLabel/FieldLabel';\nimport { FieldWrapper } from '../../../Input/FieldWrapper/FieldWrapper';\nimport { CloseIcon } from '../../../Icon/FixedIcons';\nimport { TextFieldViewProps } from './TextField.props';\n\nconst TextFieldView: React.FC<TextFieldViewProps> = ({\n id,\n name,\n label,\n hint,\n value,\n onChange,\n left,\n right,\n helperText,\n placeholder,\n onChangeText,\n shadow = {},\n views = { container: {}, field: {}, label: {}, helperText: {}, text: {} },\n size = 'md',\n shape = 'default',\n variant = 'default',\n error = false,\n isFocused = false,\n isHovered = false,\n isDisabled = false,\n isReadOnly = false,\n isClearable = true,\n isAutoFocus = false,\n isRequired,\n required,\n labelProps,\n isMultiline,\n multiline,\n rows,\n leftIcon,\n rightIcon,\n setHint = () => {},\n setIsFocused = () => {},\n setIsHovered = () => {},\n setValue = () => {},\n onClick = () => {},\n onFocus,\n onBlur = () => {},\n themeMode: elementMode,\n inputRef,\n ...props\n}) => {\n const generatedId = React.useId();\n const fieldId = id ?? generatedId;\n const isTextArea = isMultiline ?? multiline ?? false;\n // A message (not a bare `true`) is rendered under the field: point to it.\n const errorId = error && error !== true ? `${fieldId}-error` : undefined;\n const { getColor, themeMode } = useTheme();\n const IconColor = getColor(isDisabled ? 'color-gray-400' : 'color-gray-500', {\n themeMode: elementMode ? elementMode : themeMode,\n });\n const showLabel = !!label;\n const fieldSizeStyles = {\n xs: {\n minHeight: 24,\n shellPaddingY: 6,\n shellPaddingX: 10,\n fontSize: 12,\n lineHeight: '16px',\n },\n sm: {\n minHeight: 32,\n shellPaddingY: 8,\n shellPaddingX: 10,\n fontSize: 12,\n lineHeight: '16px',\n },\n md: {\n minHeight: 40,\n shellPaddingY: 10,\n shellPaddingX: 12,\n fontSize: 14,\n lineHeight: '20px',\n },\n lg: {\n minHeight: 48,\n shellPaddingY: 12,\n shellPaddingX: 14,\n fontSize: 16,\n lineHeight: '24px',\n },\n xl: {\n minHeight: 56,\n shellPaddingY: 14,\n shellPaddingX: 16,\n fontSize: 18,\n lineHeight: '28px',\n },\n } as const;\n const fieldView = views?.field || {};\n const autofillShadow = '0 0 0 1000px var(--theme-canvas) inset';\n const fieldStyles = {\n margin: 0,\n paddingVertical: 0,\n paddingHorizontal: 0,\n width: '100%',\n minHeight: 'auto',\n border: 'none',\n backgroundColor: 'transparent',\n fontSize: fieldSizeStyles[size].fontSize,\n letterSpacing: '-0.01em',\n fontWeight: 400,\n color: isDisabled ? 'color-gray-400' : 'color-gray-900',\n cursor: isDisabled ? 'not-allowed' : 'text',\n opacity: isDisabled ? 0.7 : 1,\n transition: 'color 0.2s ease, opacity 0.2s ease',\n _focus: {\n outline: 'none',\n _placeholder: {\n opacity: 0.7,\n },\n },\n _placeholder: {\n color: 'color-gray-400',\n opacity: 1,\n transition: 'opacity 0.2s ease-out',\n },\n _selection: {\n backgroundColor:\n 'color-mix(in srgb, var(--theme-primary) 20%, transparent)',\n },\n _webkitAutofill: {\n boxShadow: autofillShadow,\n WebkitBoxShadow: autofillShadow,\n WebkitTextFillColor: 'var(--theme-text)',\n transition: 'background-color 5000s ease-in-out 0s',\n },\n _webkitContactsAutoFillButton: {\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n right: 0,\n } as const,\n ...fieldView,\n };\n const handleFocus = () => {\n setIsFocused(true);\n if (onFocus) onFocus();\n };\n const handleMouseEnter = () => setIsHovered(true);\n const handleMouseLeave = () => setIsHovered(false);\n const handleBlur = (event: any) => {\n if (onBlur) onBlur(event);\n setIsFocused(false);\n };\n const handleChange = (event: React.ChangeEvent<any> | string) => {\n if (typeof event === 'string') {\n setValue(event);\n if (onChangeText) onChangeText(event);\n if (onChange) onChange(event);\n } else {\n setValue(event.target.value);\n if (onChangeText) onChangeText(event.target.value);\n if (onChange) onChange(event.target.value);\n }\n };\n const handleClear = () => {\n setValue('');\n // Both change callbacks fire unconditionally — gating `onChangeText` on\n // `onChange` being present meant the clear button was a no-op for every\n // consumer that only passes `onChangeText` (which is what the Formik\n // wrapper does for text fields).\n if (onChangeText) onChangeText('');\n if (onChange) onChange('');\n onBlur({ target: { name } });\n };\n const {\n container: _shellContainer,\n content: _shellContent,\n ...layoutViews\n } = views || {};\n return (\n <FieldContainer\n helperText={helperText}\n error={error}\n errorId={errorId}\n views={layoutViews}\n >\n <FieldContent\n label={label}\n size={size}\n error={error}\n shape={shape}\n views={views}\n shadow={shadow}\n variant={variant}\n value={value}\n color={'theme-primary'}\n isHovered={isHovered}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isFocused={isFocused}\n showLabel={showLabel}\n // Sizing comes from FieldContent's shared scale (`Input/fieldSizes`),\n // so every field control agrees on what `md` means.\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {left}\n {leftIcon && <FieldIcons>{leftIcon}</FieldIcons>}\n <FieldWrapper>\n {showLabel && (\n <FieldLabel\n htmlFor={fieldId}\n color={'theme-primary'}\n error={error}\n {...labelProps}\n {...views?.label}\n >\n {label}\n </FieldLabel>\n )}\n <Input\n ref={inputRef}\n {...(isTextArea\n ? { as: 'textarea', rows: rows ?? 5 }\n : { type: 'text' })}\n id={fieldId}\n name={name}\n readOnly={isReadOnly}\n disabled={isDisabled}\n autoFocus={isAutoFocus}\n aria-invalid={error ? true : undefined}\n aria-describedby={errorId}\n {...(isRequired ?? required\n ? { required: true, 'aria-required': true }\n : {})}\n placeholder={placeholder || hint}\n onFocus={handleFocus}\n onBlur={handleBlur}\n autoComplete=\"off\"\n {...fieldStyles}\n {...props}\n onChange={handleChange}\n value={value}\n />\n </FieldWrapper>\n {isClearable && value && !isReadOnly && !isDisabled && (\n <FieldIcons>\n <CloseIcon\n size={20}\n color={IconColor}\n onClick={handleClear}\n cursor=\"pointer\"\n borderRadius=\"50%\"\n transition=\"background-color 0.2s ease, transform 0.2s ease\"\n _hover={{\n backgroundColor: 'color-gray-100',\n transform: 'scale(1.05)',\n }}\n _active={{\n transform: 'scale(0.95)',\n }}\n />\n </FieldIcons>\n )}\n {rightIcon && <FieldIcons>{rightIcon}</FieldIcons>}\n {right}\n </FieldContent>\n </FieldContainer>\n );\n};\nexport default TextFieldView;\n",
|
|
105
|
+
"content": "/**\n * TextField View Component\n *\n * Renders a text input field with various styles and states\n * according to the design guidelines.\n */\n\nimport React from 'react';\nimport { Input, useTheme } from 'app-studio';\nimport { FieldContainer } from '../../../Input/FieldContainer/FieldContainer';\nimport { FieldContent } from '../../../Input/FieldContent/FieldContent';\nimport { FieldIcons } from '../../../Input/FieldIcons/FieldIcons';\nimport { FieldLabel } from '../../../Input/FieldLabel/FieldLabel';\nimport { FieldWrapper } from '../../../Input/FieldWrapper/FieldWrapper';\nimport { CloseIcon } from '../../../Icon/FixedIcons';\nimport { TextFieldViewProps } from './TextField.props';\n\nconst TextFieldView: React.FC<TextFieldViewProps> = ({\n id,\n name,\n label,\n hint,\n value,\n onChange,\n left,\n right,\n helperText,\n placeholder,\n onChangeText,\n shadow = {},\n views = { container: {}, field: {}, label: {}, helperText: {}, text: {} },\n themeContainer,\n size = 'md',\n shape = 'default',\n variant = 'default',\n error = false,\n isFocused = false,\n isHovered = false,\n isDisabled = false,\n isReadOnly = false,\n isClearable = true,\n isAutoFocus = false,\n isRequired,\n required,\n labelProps,\n isMultiline,\n multiline,\n rows,\n leftIcon,\n rightIcon,\n setHint = () => {},\n setIsFocused = () => {},\n setIsHovered = () => {},\n setValue = () => {},\n onClick = () => {},\n onFocus,\n onBlur = () => {},\n themeMode: elementMode,\n inputRef,\n ...props\n}) => {\n const generatedId = React.useId();\n const fieldId = id ?? generatedId;\n const isTextArea = isMultiline ?? multiline ?? false;\n // A message (not a bare `true`) is rendered under the field: point to it.\n const errorId = error && error !== true ? `${fieldId}-error` : undefined;\n const { getColor, themeMode } = useTheme();\n const IconColor = getColor(isDisabled ? 'color-gray-400' : 'color-gray-500', {\n themeMode: elementMode ? elementMode : themeMode,\n });\n const showLabel = !!label;\n const fieldSizeStyles = {\n xs: {\n minHeight: 24,\n shellPaddingY: 6,\n shellPaddingX: 10,\n fontSize: 12,\n lineHeight: '16px',\n },\n sm: {\n minHeight: 32,\n shellPaddingY: 8,\n shellPaddingX: 10,\n fontSize: 12,\n lineHeight: '16px',\n },\n md: {\n minHeight: 40,\n shellPaddingY: 10,\n shellPaddingX: 12,\n fontSize: 14,\n lineHeight: '20px',\n },\n lg: {\n minHeight: 48,\n shellPaddingY: 12,\n shellPaddingX: 14,\n fontSize: 16,\n lineHeight: '24px',\n },\n xl: {\n minHeight: 56,\n shellPaddingY: 14,\n shellPaddingX: 16,\n fontSize: 18,\n lineHeight: '28px',\n },\n } as const;\n const fieldView = views?.field || {};\n const autofillShadow = '0 0 0 1000px var(--theme-canvas) inset';\n const fieldStyles = {\n margin: 0,\n paddingVertical: 0,\n paddingHorizontal: 0,\n width: '100%',\n minHeight: 'auto',\n border: 'none',\n backgroundColor: 'transparent',\n fontSize: fieldSizeStyles[size].fontSize,\n letterSpacing: '-0.01em',\n fontWeight: 400,\n color: isDisabled ? 'color-gray-400' : 'color-gray-900',\n cursor: isDisabled ? 'not-allowed' : 'text',\n opacity: isDisabled ? 0.7 : 1,\n transition: 'color 0.2s ease, opacity 0.2s ease',\n _focus: {\n outline: 'none',\n _placeholder: {\n opacity: 0.7,\n },\n },\n _placeholder: {\n color: 'color-gray-400',\n opacity: 1,\n transition: 'opacity 0.2s ease-out',\n },\n _selection: {\n backgroundColor:\n 'color-mix(in srgb, var(--theme-primary) 20%, transparent)',\n },\n _webkitAutofill: {\n boxShadow: autofillShadow,\n WebkitBoxShadow: autofillShadow,\n WebkitTextFillColor: 'var(--theme-text)',\n transition: 'background-color 5000s ease-in-out 0s',\n },\n _webkitContactsAutoFillButton: {\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n right: 0,\n } as const,\n ...fieldView,\n };\n const handleFocus = () => {\n setIsFocused(true);\n if (onFocus) onFocus();\n };\n const handleMouseEnter = () => setIsHovered(true);\n const handleMouseLeave = () => setIsHovered(false);\n const handleBlur = (event: any) => {\n if (onBlur) onBlur(event);\n setIsFocused(false);\n };\n const handleChange = (event: React.ChangeEvent<any> | string) => {\n if (typeof event === 'string') {\n setValue(event);\n if (onChangeText) onChangeText(event);\n if (onChange) onChange(event);\n } else {\n setValue(event.target.value);\n if (onChangeText) onChangeText(event.target.value);\n if (onChange) onChange(event.target.value);\n }\n };\n const handleClear = () => {\n setValue('');\n // Both change callbacks fire unconditionally — gating `onChangeText` on\n // `onChange` being present meant the clear button was a no-op for every\n // consumer that only passes `onChangeText` (which is what the Formik\n // wrapper does for text fields).\n if (onChangeText) onChangeText('');\n if (onChange) onChange('');\n onBlur({ target: { name } });\n };\n const {\n container: _shellContainer,\n content: _shellContent,\n ...layoutViews\n } = views || {};\n return (\n <FieldContainer\n helperText={helperText}\n error={error}\n errorId={errorId}\n views={layoutViews}\n >\n <FieldContent\n label={label}\n size={size}\n error={error}\n shape={shape}\n views={views}\n themeContainer={themeContainer}\n shadow={shadow}\n variant={variant}\n value={value}\n color={'theme-primary'}\n isHovered={isHovered}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isFocused={isFocused}\n showLabel={showLabel}\n // Sizing comes from FieldContent's shared scale (`Input/fieldSizes`),\n // so every field control agrees on what `md` means.\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {left}\n {leftIcon && <FieldIcons>{leftIcon}</FieldIcons>}\n <FieldWrapper>\n {showLabel && (\n <FieldLabel\n htmlFor={fieldId}\n color={'theme-primary'}\n error={error}\n {...labelProps}\n {...views?.label}\n >\n {label}\n </FieldLabel>\n )}\n <Input\n ref={inputRef}\n {...(isTextArea\n ? { as: 'textarea', rows: rows ?? 5 }\n : { type: 'text' })}\n id={fieldId}\n name={name}\n readOnly={isReadOnly}\n disabled={isDisabled}\n autoFocus={isAutoFocus}\n aria-invalid={error ? true : undefined}\n aria-describedby={errorId}\n {...(isRequired ?? required\n ? { required: true, 'aria-required': true }\n : {})}\n placeholder={placeholder || hint}\n onFocus={handleFocus}\n onBlur={handleBlur}\n autoComplete=\"off\"\n {...fieldStyles}\n {...props}\n onChange={handleChange}\n value={value}\n />\n </FieldWrapper>\n {isClearable && value && !isReadOnly && !isDisabled && (\n <FieldIcons>\n <CloseIcon\n size={20}\n color={IconColor}\n onClick={handleClear}\n cursor=\"pointer\"\n borderRadius=\"50%\"\n transition=\"background-color 0.2s ease, transform 0.2s ease\"\n _hover={{\n backgroundColor: 'color-gray-100',\n transform: 'scale(1.05)',\n }}\n _active={{\n transform: 'scale(0.95)',\n }}\n />\n </FieldIcons>\n )}\n {rightIcon && <FieldIcons>{rightIcon}</FieldIcons>}\n {right}\n </FieldContent>\n </FieldContainer>\n );\n};\nexport default TextFieldView;\n",
|
|
103
106
|
"type": "registry:ui"
|
|
104
107
|
},
|
|
105
108
|
{
|
|
@@ -129,12 +132,12 @@
|
|
|
129
132
|
},
|
|
130
133
|
{
|
|
131
134
|
"path": "src/components/Input/FieldContent/FieldContent.tsx",
|
|
132
|
-
"content": "/**\n * FieldContent Component\n *\n * Renders the content area of a form field with various styles and states\n * according to the design guidelines.\n */\n\nimport React from 'react';\nimport { Typography, useTheme } from 'app-studio';\n\nimport { InputVariants, Shapes } from '../Input.style';\nimport { fieldSizeProps } from '../fieldSizes';\nimport { Horizontal } from 'app-studio';\n\nimport { ContentProps } from './FieldContent/FieldContent.props';\n\nexport const FieldContent: React.FC<ContentProps> = ({\n label,\n shadow,\n children,\n value,\n size = 'md',\n shape = 'default',\n variant = 'default',\n error = false,\n showLabel = false,\n isFocused = false,\n isHovered = false,\n isDisabled = false,\n isReadOnly = false,\n views = { pickerBox: {} },\n ...props\n}) => {\n const { themeMode } = useTheme();\n const isDark = themeMode === 'dark';\n\n // Determine if the field is in an interactive state\n const isInteractive = (isHovered || isFocused) && !isDisabled;\n const color = error\n ? 'color-red-500'\n : isInteractive\n ? 'theme-primary'\n : 'color-gray-200';\n\n return (\n <Horizontal\n gap={8}\n width=\"100%\"\n // Fields set `width: 100%` and then add their own padding/border, so they\n // only fit their container under border-box. Declared here rather than\n // relying on a host `* { box-sizing: border-box }` reset, whose absence\n // otherwise makes every field overflow its parent by padding + border.\n boxSizing=\"border-box\"\n display=\"flex\"\n flexWrap=\"nowrap\"\n alignItems=\"center\"\n justifyContent=\"flex-start\"\n borderStyle=\"solid\"\n borderColor={color}\n backgroundColor={isDark ? 'color-gray-900' : 'color-white'}\n fontSize={Typography.fontSizes[size]}\n cursor={isDisabled ? 'not-allowed' : isReadOnly ? 'auto' : 'text'}\n opacity={isDisabled ? 0.7 : 1}\n transition=\"border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease\"\n // Sizing belongs to the shell, not to each field: without it every field\n // rendered at roughly `md` height whatever size was asked for. Placed\n // before `views`/`props` so a caller can still override.\n {...fieldSizeProps(size)}\n {...(typeof shadow === 'object' && shadow !== null ? shadow : {})}\n {...Shapes[shape]}\n {...
|
|
135
|
+
"content": "/**\n * FieldContent Component\n *\n * Renders the content area of a form field with various styles and states\n * according to the design guidelines.\n */\n\nimport React from 'react';\nimport { Typography, useTheme } from 'app-studio';\n\nimport { InputVariants, Shapes } from '../Input.style';\nimport { fieldSizeProps } from '../fieldSizes';\nimport { Horizontal } from 'app-studio';\n\nimport { ContentProps } from './FieldContent/FieldContent.props';\nimport { mergeDesignSystemViews } from '../../../design-system/theme';\n\nexport const FieldContent: React.FC<ContentProps> = ({\n label,\n shadow,\n children,\n value,\n size = 'md',\n shape = 'default',\n variant = 'default',\n error = false,\n showLabel = false,\n isFocused = false,\n isHovered = false,\n isDisabled = false,\n isReadOnly = false,\n views = { pickerBox: {} },\n themeContainer,\n ...props\n}) => {\n const { themeMode } = useTheme();\n const isDark = themeMode === 'dark';\n\n // Determine if the field is in an interactive state\n const isInteractive = (isHovered || isFocused) && !isDisabled;\n const color = error\n ? 'color-red-500'\n : isInteractive\n ? 'theme-primary'\n : 'color-gray-200';\n const variantStyle = InputVariants[variant];\n let container = views?.container;\n if (themeContainer) {\n const { borderRadius, ...style } = variantStyle ?? {};\n const decoration =\n variant === 'none'\n ? { borderWidth: 0, backgroundColor: 'transparent' }\n : {\n ...style,\n borderColor: error || isInteractive ? color : style.borderColor,\n };\n container = mergeDesignSystemViews(\n { container: themeContainer },\n { container: decoration },\n { container }\n ).container;\n }\n\n return (\n <Horizontal\n gap={8}\n width=\"100%\"\n // Fields set `width: 100%` and then add their own padding/border, so they\n // only fit their container under border-box. Declared here rather than\n // relying on a host `* { box-sizing: border-box }` reset, whose absence\n // otherwise makes every field overflow its parent by padding + border.\n boxSizing=\"border-box\"\n display=\"flex\"\n flexWrap=\"nowrap\"\n alignItems=\"center\"\n justifyContent=\"flex-start\"\n borderStyle=\"solid\"\n borderColor={color}\n backgroundColor={isDark ? 'color-gray-900' : 'color-white'}\n fontSize={Typography.fontSizes[size]}\n cursor={isDisabled ? 'not-allowed' : isReadOnly ? 'auto' : 'text'}\n opacity={isDisabled ? 0.7 : 1}\n _focusWithin={{ outline: '2px solid theme-primary', outlineOffset: 2 }}\n transition=\"border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease\"\n // Sizing belongs to the shell, not to each field: without it every field\n // rendered at roughly `md` height whatever size was asked for. Placed\n // before `views`/`props` so a caller can still override.\n {...fieldSizeProps(size)}\n {...(typeof shadow === 'object' && shadow !== null ? shadow : {})}\n {...Shapes[shape]}\n {...(!themeContainer && variantStyle)}\n {...container}\n {...props}\n >\n {children}\n </Horizontal>\n );\n};\n",
|
|
133
136
|
"type": "registry:ui"
|
|
134
137
|
},
|
|
135
138
|
{
|
|
136
139
|
"path": "src/components/Input/FieldContent/FieldContent/FieldContent.props.ts",
|
|
137
|
-
"content": "import React from 'react';\nimport { Shape, Size, TextFieldStyles, Variant } from '../../Input.type';\nimport { Shadow, ViewProps } from 'app-studio';\nimport { Elevation } from '../../../../utils/elevation';\n\nexport interface ContentProps extends Omit<ViewProps, 'size' | 'shadow'> {\n /**\n * Shadow applied to the field shell. Accepts the design-system primitives\n * (boolean / number / Shadow), the consumer's elevation token, or a raw\n * ViewProps-shaped style object used as a shadow descriptor.\n */\n shadow?: boolean | number | Shadow | Elevation | ViewProps;\n /**\n * The color of the Content component.\n */\n color?: string;\n /**\n * The content to be rendered inside the Content component.\n */\n children?: React.ReactNode;\n /**\n * Indicates whether the field has an error.\n */\n error?: boolean;\n /**\n * Indicates whether the field has label\n */\n showLabel?: boolean;\n /**\n * Determines whether the Content component is disabled. Default value is false.\n */\n isDisabled?: boolean;\n /**\n * Determines wheter the field is focused or not.\n */\n isFocused?: boolean;\n /**\n * Determines whether the Content component is currently being hovered over.\n */\n isHovered?: boolean;\n /**\n * Determines whether the Content component is read-only. Default value is false.\n */\n isReadOnly?: boolean;\n /**\n * The label associated with the Content component.\n */\n label?: string;\n /**\n * The default value of the field. Accepts the same shape as\n * HTMLInputElement.value (including `readonly string[]` for compatibility\n * with React 19's stricter Input typing).\n */\n value?: string | number | readonly string[];\n /**\n * Changes the Input style\n */\n variant?: Variant;\n /**\n * The shape of the Content component.\n */\n shape?: Shape;\n /**\n * The size of the Content component. Default value is \"md\".\n */\n size?: Size;\n /**\n * CSS styles applied to the Content component. Default value is an empty object.\n */\n views?: TextFieldStyles;\n}\n",
|
|
140
|
+
"content": "import React from 'react';\nimport { Shape, Size, TextFieldStyles, Variant } from '../../Input.type';\nimport { Shadow, ViewProps } from 'app-studio';\nimport { Elevation } from '../../../../utils/elevation';\n\nexport interface ContentProps extends Omit<ViewProps, 'size' | 'shadow'> {\n themeContainer?: ViewProps;\n /**\n * Shadow applied to the field shell. Accepts the design-system primitives\n * (boolean / number / Shadow), the consumer's elevation token, or a raw\n * ViewProps-shaped style object used as a shadow descriptor.\n */\n shadow?: boolean | number | Shadow | Elevation | ViewProps;\n /**\n * The color of the Content component.\n */\n color?: string;\n /**\n * The content to be rendered inside the Content component.\n */\n children?: React.ReactNode;\n /**\n * Indicates whether the field has an error.\n */\n error?: boolean;\n /**\n * Indicates whether the field has label\n */\n showLabel?: boolean;\n /**\n * Determines whether the Content component is disabled. Default value is false.\n */\n isDisabled?: boolean;\n /**\n * Determines wheter the field is focused or not.\n */\n isFocused?: boolean;\n /**\n * Determines whether the Content component is currently being hovered over.\n */\n isHovered?: boolean;\n /**\n * Determines whether the Content component is read-only. Default value is false.\n */\n isReadOnly?: boolean;\n /**\n * The label associated with the Content component.\n */\n label?: string;\n /**\n * The default value of the field. Accepts the same shape as\n * HTMLInputElement.value (including `readonly string[]` for compatibility\n * with React 19's stricter Input typing).\n */\n value?: string | number | readonly string[];\n /**\n * Changes the Input style\n */\n variant?: Variant;\n /**\n * The shape of the Content component.\n */\n shape?: Shape;\n /**\n * The size of the Content component. Default value is \"md\".\n */\n size?: Size;\n /**\n * CSS styles applied to the Content component. Default value is an empty object.\n */\n views?: TextFieldStyles;\n}\n",
|
|
138
141
|
"type": "registry:ui"
|
|
139
142
|
},
|
|
140
143
|
{
|
|
@@ -192,6 +195,11 @@
|
|
|
192
195
|
"content": "import { ViewProps } from 'app-studio';\n\nexport type Variant = 'outline' | 'default' | 'none';\n\nexport type Shape = 'default' | 'square' | 'rounded' | 'pill';\n\nexport type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport type TextFieldStyles = {\n text?: ViewProps;\n label?: ViewProps;\n error?: ViewProps;\n helperText?: ViewProps;\n container?: ViewProps;\n};\n\nexport type Wrap = 'wrap' | 'nowrap' | 'wrap-reverse';\n\nexport type Justify =\n | 'flex-start'\n | 'center'\n | 'flex-end'\n | 'space-between'\n | 'space-around'\n | 'space-evenly';\n",
|
|
193
196
|
"type": "registry:ui"
|
|
194
197
|
},
|
|
198
|
+
{
|
|
199
|
+
"path": "src/components/Input/useFieldDesignSystemProps.ts",
|
|
200
|
+
"content": "import type { ViewProps } from 'app-studio';\nimport {\n mergeDesignSystemViews,\n useDesignSystemComponentLayers,\n} from '../../design-system/theme';\n\nexport function useFieldDesignSystemProps<\n T extends { views?: { container?: ViewProps } }\n>(\n name: 'input' | 'select',\n props: T\n): { props: T; themeContainer?: ViewProps } {\n const layers = useDesignSystemComponentLayers(name, props);\n if (!layers.themeViews) return { props: layers.props };\n\n const { container = {}, ...otherThemeViews } = layers.themeViews;\n return {\n props: {\n ...layers.props,\n views: mergeDesignSystemViews(\n otherThemeViews as Partial<NonNullable<T['views']>>,\n layers.props.views\n ),\n },\n themeContainer: container,\n };\n}\n",
|
|
201
|
+
"type": "registry:ui"
|
|
202
|
+
},
|
|
195
203
|
{
|
|
196
204
|
"path": "src/components/pilot/text-field.ts",
|
|
197
205
|
"content": "export * from '../Form/TextField/TextField';\nexport type { TextFieldProps } from '../Form/TextField/TextField/TextField.props';\n",
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "theme",
|
|
4
|
+
"type": "registry:lib",
|
|
5
|
+
"title": "Theme",
|
|
6
|
+
"author": "App Studio",
|
|
7
|
+
"categories": [
|
|
8
|
+
"Foundations"
|
|
9
|
+
],
|
|
10
|
+
"registryDependencies": [],
|
|
11
|
+
"meta": {
|
|
12
|
+
"appStudio": {
|
|
13
|
+
"entry": "src/design-system/theme.tsx",
|
|
14
|
+
"engine": ">=0.9.5",
|
|
15
|
+
"engineByPlatform": {
|
|
16
|
+
"ios": ">=0.10.0",
|
|
17
|
+
"android": ">=0.10.0"
|
|
18
|
+
},
|
|
19
|
+
"version": "0.12.1",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"platforms": [
|
|
22
|
+
"web",
|
|
23
|
+
"ios",
|
|
24
|
+
"android"
|
|
25
|
+
],
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"web": [],
|
|
28
|
+
"ios": [],
|
|
29
|
+
"android": []
|
|
30
|
+
},
|
|
31
|
+
"npmImport": "@app-studio/components/theme"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
{
|
|
36
|
+
"path": "LICENSE.txt",
|
|
37
|
+
"content": "Copyright (c) Facebook, Inc. and its affiliates.\nAll rights reserved.\n\nThis source code is licensed under the license found in the\nLICENSE file in the root directory of this source tree.\n\nAttribution-NonCommercial 4.0 International\n\n=======================================================================\n\nCreative Commons Corporation (\"Creative Commons\") is not a law firm and\ndoes not provide legal services or legal advice. Distribution of\nCreative Commons public licenses does not create a lawyer-client or\nother relationship. Creative Commons makes its licenses and related\ninformation available on an \"as-is\" basis. Creative Commons gives no\nwarranties regarding its licenses, any material licensed under their\nterms and conditions, or any related information. Creative Commons\ndisclaims all liability for damages resulting from their use to the\nfullest extent possible.\n\nUsing Creative Commons Public Licenses\n\nCreative Commons public licenses provide a standard set of terms and\nconditions that creators and other rights holders may use to share\noriginal works of authorship and other material subject to copyright\nand certain other rights specified in the public license below. The\nfollowing considerations are for informational purposes only, are not\nexhaustive, and do not form part of our licenses.\n\n Considerations for licensors: Our public licenses are\n intended for use by those authorized to give the public\n permission to use material in ways otherwise restricted by\n copyright and certain other rights. Our licenses are\n irrevocable. Licensors should read and understand the terms\n and conditions of the license they choose before applying it.\n Licensors should also secure all rights necessary before\n applying our licenses so that the public can reuse the\n material as expected. Licensors should clearly mark any\n material not subject to the license. This includes other CC-\n licensed material, or material used under an exception or\n limitation to copyright. More considerations for licensors:\n\twiki.creativecommons.org/Considerations_for_licensors\n\n Considerations for the public: By using one of our public\n licenses, a licensor grants the public permission to use the\n licensed material under specified terms and conditions. If\n the licensor's permission is not necessary for any reason--for\n example, because of any applicable exception or limitation to\n copyright--then that use is not regulated by the license. Our\n licenses grant only permissions under copyright and certain\n other rights that a licensor has authority to grant. Use of\n the licensed material may still be restricted for other\n reasons, including because others have copyright or other\n rights in the material. A licensor may make special requests,\n such as asking that all changes be marked or described.\n Although not required by our licenses, you are encouraged to\n respect those requests where reasonable. More_considerations\n for the public: \n\twiki.creativecommons.org/Considerations_for_licensees\n\n=======================================================================\n\nCreative Commons Attribution-NonCommercial 4.0 International Public\nLicense\n\nBy exercising the Licensed Rights (defined below), You accept and agree\nto be bound by the terms and conditions of this Creative Commons\nAttribution-NonCommercial 4.0 International Public License (\"Public\nLicense\"). To the extent this Public License may be interpreted as a\ncontract, You are granted the Licensed Rights in consideration of Your\nacceptance of these terms and conditions, and the Licensor grants You\nsuch rights in consideration of benefits the Licensor receives from\nmaking the Licensed Material available under these terms and\nconditions.\n\nSection 1 -- Definitions.\n\n a. Adapted Material means material subject to Copyright and Similar\n Rights that is derived from or based upon the Licensed Material\n and in which the Licensed Material is translated, altered,\n arranged, transformed, or otherwise modified in a manner requiring\n permission under the Copyright and Similar Rights held by the\n Licensor. For purposes of this Public License, where the Licensed\n Material is a musical work, performance, or sound recording,\n Adapted Material is always produced where the Licensed Material is\n synched in timed relation with a moving image.\n\n b. Adapter's License means the license You apply to Your Copyright\n and Similar Rights in Your contributions to Adapted Material in\n accordance with the terms and conditions of this Public License.\n\n c. Copyright and Similar Rights means copyright and/or similar rights\n closely related to copyright including, without limitation,\n performance, broadcast, sound recording, and Sui Generis Database\n Rights, without regard to how the rights are labeled or\n categorized. For purposes of this Public License, the rights\n specified in Section 2(b)(1)-(2) are not Copyright and Similar\n Rights.\n d. Effective Technological Measures means those measures that, in the\n absence of proper authority, may not be circumvented under laws\n fulfilling obligations under Article 11 of the WIPO Copyright\n Treaty adopted on December 20, 1996, and/or similar international\n agreements.\n\n e. Exceptions and Limitations means fair use, fair dealing, and/or\n any other exception or limitation to Copyright and Similar Rights\n that applies to Your use of the Licensed Material.\n\n f. Licensed Material means the artistic or literary work, database,\n or other material to which the Licensor applied this Public\n License.\n\n g. Licensed Rights means the rights granted to You subject to the\n terms and conditions of this Public License, which are limited to\n all Copyright and Similar Rights that apply to Your use of the\n Licensed Material and that the Licensor has authority to license.\n\n h. Licensor means the individual(s) or entity(ies) granting rights\n under this Public License.\n\n i. NonCommercial means not primarily intended for or directed towards\n commercial advantage or monetary compensation. For purposes of\n this Public License, the exchange of the Licensed Material for\n other material subject to Copyright and Similar Rights by digital\n file-sharing or similar means is NonCommercial provided there is\n no payment of monetary compensation in connection with the\n exchange.\n\n j. Share means to provide material to the public by any means or\n process that requires permission under the Licensed Rights, such\n as reproduction, public display, public performance, distribution,\n dissemination, communication, or importation, and to make material\n available to the public including in ways that members of the\n public may access the material from a place and at a time\n individually chosen by them.\n\n k. Sui Generis Database Rights means rights other than copyright\n resulting from Directive 96/9/EC of the European Parliament and of\n the Council of 11 March 1996 on the legal protection of databases,\n as amended and/or succeeded, as well as other essentially\n equivalent rights anywhere in the world.\n\n l. You means the individual or entity exercising the Licensed Rights\n under this Public License. Your has a corresponding meaning.\n\nSection 2 -- Scope.\n\n a. License grant.\n\n 1. Subject to the terms and conditions of this Public License,\n the Licensor hereby grants You a worldwide, royalty-free,\n non-sublicensable, non-exclusive, irrevocable license to\n exercise the Licensed Rights in the Licensed Material to:\n\n a. reproduce and Share the Licensed Material, in whole or\n in part, for NonCommercial purposes only; and\n\n b. produce, reproduce, and Share Adapted Material for\n NonCommercial purposes only.\n\n 2. Exceptions and Limitations. For the avoidance of doubt, where\n Exceptions and Limitations apply to Your use, this Public\n License does not apply, and You do not need to comply with\n its terms and conditions.\n\n 3. Term. The term of this Public License is specified in Section\n 6(a).\n\n 4. Media and formats; technical modifications allowed. The\n Licensor authorizes You to exercise the Licensed Rights in\n all media and formats whether now known or hereafter created,\n and to make technical modifications necessary to do so. The\n Licensor waives and/or agrees not to assert any right or\n authority to forbid You from making technical modifications\n necessary to exercise the Licensed Rights, including\n technical modifications necessary to circumvent Effective\n Technological Measures. For purposes of this Public License,\n simply making modifications authorized by this Section 2(a)\n (4) never produces Adapted Material.\n\n 5. Downstream recipients.\n\n a. Offer from the Licensor -- Licensed Material. Every\n recipient of the Licensed Material automatically\n receives an offer from the Licensor to exercise the\n Licensed Rights under the terms and conditions of this\n Public License.\n\n b. No downstream restrictions. You may not offer or impose\n any additional or different terms or conditions on, or\n apply any Effective Technological Measures to, the\n Licensed Material if doing so restricts exercise of the\n Licensed Rights by any recipient of the Licensed\n Material.\n\n 6. No endorsement. Nothing in this Public License constitutes or\n may be construed as permission to assert or imply that You\n are, or that Your use of the Licensed Material is, connected\n with, or sponsored, endorsed, or granted official status by,\n the Licensor or others designated to receive attribution as\n provided in Section 3(a)(1)(A)(i).\n\n b. Other rights.\n\n 1. Moral rights, such as the right of integrity, are not\n licensed under this Public License, nor are publicity,\n privacy, and/or other similar personality rights; however, to\n the extent possible, the Licensor waives and/or agrees not to\n assert any such rights held by the Licensor to the limited\n extent necessary to allow You to exercise the Licensed\n Rights, but not otherwise.\n\n 2. Patent and trademark rights are not licensed under this\n Public License.\n\n 3. To the extent possible, the Licensor waives any right to\n collect royalties from You for the exercise of the Licensed\n Rights, whether directly or through a collecting society\n under any voluntary or waivable statutory or compulsory\n licensing scheme. In all other cases the Licensor expressly\n reserves any right to collect such royalties, including when\n the Licensed Material is used other than for NonCommercial\n purposes.\n\nSection 3 -- License Conditions.\n\nYour exercise of the Licensed Rights is expressly made subject to the\nfollowing conditions.\n\n a. Attribution.\n\n 1. If You Share the Licensed Material (including in modified\n form), You must:\n\n a. retain the following if it is supplied by the Licensor\n with the Licensed Material:\n\n i. identification of the creator(s) of the Licensed\n Material and any others designated to receive\n attribution, in any reasonable manner requested by\n the Licensor (including by pseudonym if\n designated);\n\n ii. a copyright notice;\n\n iii. a notice that refers to this Public License;\n\n iv. a notice that refers to the disclaimer of\n warranties;\n\n v. a URI or hyperlink to the Licensed Material to the\n extent reasonably practicable;\n\n b. indicate if You modified the Licensed Material and\n retain an indication of any previous modifications; and\n\n c. indicate the Licensed Material is licensed under this\n Public License, and include the text of, or the URI or\n hyperlink to, this Public License.\n\n 2. You may satisfy the conditions in Section 3(a)(1) in any\n reasonable manner based on the medium, means, and context in\n which You Share the Licensed Material. For example, it may be\n reasonable to satisfy the conditions by providing a URI or\n hyperlink to a resource that includes the required\n information.\n\n 3. If requested by the Licensor, You must remove any of the\n information required by Section 3(a)(1)(A) to the extent\n reasonably practicable.\n\n 4. If You Share Adapted Material You produce, the Adapter's\n License You apply must not prevent recipients of the Adapted\n Material from complying with this Public License.\n\nSection 4 -- Sui Generis Database Rights.\n\nWhere the Licensed Rights include Sui Generis Database Rights that\napply to Your use of the Licensed Material:\n\n a. for the avoidance of doubt, Section 2(a)(1) grants You the right\n to extract, reuse, reproduce, and Share all or a substantial\n portion of the contents of the database for NonCommercial purposes\n only;\n\n b. if You include all or a substantial portion of the database\n contents in a database in which You have Sui Generis Database\n Rights, then the database in which You have Sui Generis Database\n Rights (but not its individual contents) is Adapted Material; and\n\n c. You must comply with the conditions in Section 3(a) if You Share\n all or a substantial portion of the contents of the database.\n\nFor the avoidance of doubt, this Section 4 supplements and does not\nreplace Your obligations under this Public License where the Licensed\nRights include other Copyright and Similar Rights.\n\nSection 5 -- Disclaimer of Warranties and Limitation of Liability.\n\n a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE\n EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS\n AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF\n ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,\n IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,\n WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR\n PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,\n ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT\n KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT\n ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.\n\n b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE\n TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,\n NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,\n INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,\n COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR\n USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN\n ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR\n DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR\n IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.\n\n c. The disclaimer of warranties and limitation of liability provided\n above shall be interpreted in a manner that, to the extent\n possible, most closely approximates an absolute disclaimer and\n waiver of all liability.\n\nSection 6 -- Term and Termination.\n\n a. This Public License applies for the term of the Copyright and\n Similar Rights licensed here. However, if You fail to comply with\n this Public License, then Your rights under this Public License\n terminate automatically.\n\n b. Where Your right to use the Licensed Material has terminated under\n Section 6(a), it reinstates:\n\n 1. automatically as of the date the violation is cured, provided\n it is cured within 30 days of Your discovery of the\n violation; or\n\n 2. upon express reinstatement by the Licensor.\n\n For the avoidance of doubt, this Section 6(b) does not affect any\n right the Licensor may have to seek remedies for Your violations\n of this Public License.\n\n c. For the avoidance of doubt, the Licensor may also offer the\n Licensed Material under separate terms or conditions or stop\n distributing the Licensed Material at any time; however, doing so\n will not terminate this Public License.\n\n d. Sections 1, 5, 6, 7, and 8 survive termination of this Public\n License.\n\nSection 7 -- Other Terms and Conditions.\n\n a. The Licensor shall not be bound by any additional or different\n terms or conditions communicated by You unless expressly agreed.\n\n b. Any arrangements, understandings, or agreements regarding the\n Licensed Material not stated herein are separate from and\n independent of the terms and conditions of this Public License.\n\nSection 8 -- Interpretation.\n\n a. For the avoidance of doubt, this Public License does not, and\n shall not be interpreted to, reduce, limit, restrict, or impose\n conditions on any use of the Licensed Material that could lawfully\n be made without permission under this Public License.\n\n b. To the extent possible, if any provision of this Public License is\n deemed unenforceable, it shall be automatically reformed to the\n minimum extent necessary to make it enforceable. If the provision\n cannot be reformed, it shall be severed from this Public License\n without affecting the enforceability of the remaining terms and\n conditions.\n\n c. No term or condition of this Public License will be waived and no\n failure to comply consented to unless expressly agreed to by the\n Licensor.\n\n d. Nothing in this Public License constitutes or may be interpreted\n as a limitation upon, or waiver of, any privileges and immunities\n that apply to the Licensor or You, including from the legal\n processes of any jurisdiction or authority.\n\n=======================================================================\n\nCreative Commons is not a party to its public\nlicenses. Notwithstanding, Creative Commons may elect to apply one of\nits public licenses to material it publishes and in those instances\nwill be considered the “Licensor.” The text of the Creative Commons\npublic licenses is dedicated to the public domain under the CC0 Public\nDomain Dedication. Except for the limited purpose of indicating that\nmaterial is shared under a Creative Commons public license or as\notherwise permitted by the Creative Commons policies published at\ncreativecommons.org/policies, Creative Commons does not authorize the\nuse of the trademark \"Creative Commons\" or any other trademark or logo\nof Creative Commons without its prior written consent including,\nwithout limitation, in connection with any unauthorized modifications\nto any of its public licenses or any other arrangements,\nunderstandings, or agreements concerning use of licensed material. For\nthe avoidance of doubt, this paragraph does not form part of the\npublic licenses.\n\nCreative Commons may be contacted at creativecommons.org.\n\n--------------------------- LICENSE FOR SMPL --------------------------------\nhttps://smpl.is.tue.mpg.de/bodylicense\n\nSMPL-Body License\nMax Planck Society e.V as Licensor\ngrants a\n\nSMPL-BODY Creative Commons License\n\nSMPL: Skinned Multi-Person Linear Model (hereinafter \"SMPL-Model\") is a 3D representation of the human body that supports realistic changes in body shape and pose. SMPL-Body is a subset of SMPL-Model which excludes the shape blendshapes or the tools to create 3D bodies using the shape blendshapes of the SMPL-Model. A SMPL-Body contains a 3D mesh, a skeleton rig, pose blendshapes and dynamic blendshapes. A SMPL-Body can be shared in the form of OBJ file(s), animated FBX file(s), or as a set of mesh vertices, skeleton rig, pose blendshapes and dynamic blendshapes in other appropriate 3D file formats.\n\nSMPL-Body is licensed under the Creative Commons Attribution 4.0 International License. You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. To view a copy of this license, visit:\n\nhttp://creativecommons.org/licenses/by/4.0/\n\nOR\n\nhttps://creativecommons.org/licenses/by/4.0/deed.de (GERMAN)\n\nThe SMPL-Model specification is defined in the granted US patent US10395411B2 (published on 2018-11-01 and 2019-08-27, granted on 2019-08-27) and the pending European EP3314577A1 (published on 2018-05-02) and World WO2016207311A1 (published on 2016-12-29) patent applications, \"Skinned Multi-Person Linear Model\". The Max Planck Society (MPG) owns the technology disclosed in these granted and pending patent applications.\n\nWith this free CC-license, we want to encourage the adoption and use of SMPL-Body and related file formats as a new Standard in 3D Body Modeling. The Grant of right qualifies as a donation under German law. As to § 521 Bürgerliches Gesetzbuch the donor is responsible only for intent and gross negligence.\n\nAttribution for Publications with SMPL-Body\nYou agree to cite the most recent paper describing the model as specified on the download website: http://smpl.is.tue.mpg.de/ This website lists the most up to date bibliographic information.\n\n--------------------------- LICENSE FOR SPIN --------------------------------\n\nCopyright (c) 2019, \nUniversity of Pennsylvania, \nMax Planck Institute for Intelligent Systems\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
|
|
38
|
+
"type": "registry:lib"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"path": "src/design-system/configs/default.json",
|
|
42
|
+
"content": "{\n \"metadata\": {\n \"id\": \"default\",\n \"label\": \"Default\",\n \"sourcePath\": \"\",\n \"sourceTitle\": \"Default adaptive design system (light + dark)\",\n \"defaultAppearance\": \"light\",\n \"googleFontLinks\": [\n \"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap\"\n ]\n },\n \"theme\": {\n \"primary\": \"#2563eb\",\n \"secondary\": \"#7c3aed\",\n \"success\": \"#16a34a\",\n \"warning\": \"#d97706\",\n \"error\": \"#dc2626\",\n \"onPrimary\": \"color-white\",\n \"canvas\": \"color-white\",\n \"surface\": \"color-gray-50\",\n \"text\": \"color-black\",\n \"muted\": \"color-gray-500\",\n \"border\": \"color-gray-200\"\n },\n \"tokens\": {\n \"rawCssVars\": {\n \"primary\": \"#2563eb\",\n \"secondary\": \"#7c3aed\",\n \"success\": \"#16a34a\",\n \"warning\": \"#d97706\",\n \"error\": \"#dc2626\"\n },\n \"colors\": [\n { \"name\": \"primary\", \"value\": \"#2563eb\", \"role\": \"primary\" },\n { \"name\": \"secondary\", \"value\": \"#7c3aed\", \"role\": \"secondary\" },\n { \"name\": \"success\", \"value\": \"#16a34a\", \"role\": \"success\" },\n { \"name\": \"warning\", \"value\": \"#d97706\", \"role\": \"warning\" },\n { \"name\": \"error\", \"value\": \"#dc2626\", \"role\": \"error\" }\n ],\n \"typography\": {\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"monoFamily\": \"ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace\",\n \"fontSizes\": [\"12px\", \"13px\", \"14px\", \"16px\", \"18px\", \"22px\", \"28px\", \"36px\", \"48px\", \"64px\"],\n \"fontWeights\": [\"400\", \"500\", \"600\", \"700\", \"800\"],\n \"lineHeights\": [\"1.0\", \"1.1\", \"1.2\", \"1.4\", \"1.5\", \"1.6\"]\n },\n \"spacing\": [\"2px\", \"4px\", \"8px\", \"12px\", \"16px\", \"24px\", \"32px\", \"48px\", \"64px\"],\n \"radii\": [\"2px\", \"4px\", \"6px\", \"8px\", \"12px\", \"16px\", \"9999px\"],\n \"shadows\": [\n \"0 1px 2px rgba(0,0,0,0.04)\",\n \"0 4px 12px rgba(0,0,0,0.08)\",\n \"0 12px 32px rgba(0,0,0,0.12)\"\n ]\n },\n \"components\": {\n \"button\": {\n \"variant\": \"filled\",\n \"size\": \"md\",\n \"shape\": \"rounded\",\n \"color\": \"theme-primary\",\n \"textColor\": \"theme-onPrimary\",\n \"views\": {\n \"container\": {\n \"borderRadius\": 8,\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontWeight\": 600,\n \"letterSpacing\": \"-0.01em\",\n \"textTransform\": \"none\",\n \"fontStyle\": \"normal\"\n },\n \"content\": {\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontWeight\": 600,\n \"letterSpacing\": \"-0.01em\",\n \"textTransform\": \"none\",\n \"fontStyle\": \"normal\"\n }\n }\n },\n \"badge\": {\n \"variant\": \"filled\",\n \"size\": \"sm\",\n \"shape\": \"rounded\",\n \"views\": {\n \"container\": {\n \"backgroundColor\": null,\n \"color\": null,\n \"borderColor\": null,\n \"borderRadius\": 6,\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"letterSpacing\": \"-0.01em\",\n \"textTransform\": \"none\",\n \"fontWeight\": 600,\n \"fontStyle\": \"normal\"\n },\n \"text\": {\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontWeight\": 600\n }\n }\n },\n \"card\": {\n \"variant\": \"outlined\",\n \"size\": \"md\",\n \"shape\": \"rounded\",\n \"views\": {\n \"container\": {\n \"backgroundColor\": \"color-gray-50\",\n \"borderColor\": \"color-gray-200\",\n \"color\": \"color-black\",\n \"borderRadius\": 12,\n \"borderWidth\": \"1px\",\n \"borderStyle\": \"solid\",\n \"boxShadow\": \"0 1px 2px rgba(0,0,0,0.04)\"\n },\n \"header\": {\n \"color\": \"color-black\",\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontWeight\": 600,\n \"borderColor\": \"color-gray-200\"\n },\n \"content\": {\n \"color\": \"color-gray-500\",\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\"\n },\n \"footer\": {\n \"borderColor\": \"color-gray-200\"\n }\n }\n },\n \"input\": {\n \"size\": \"md\",\n \"shape\": \"default\",\n \"variant\": \"default\",\n \"views\": {\n \"container\": {\n \"backgroundColor\": \"color-white\",\n \"borderColor\": \"color-gray-200\",\n \"color\": \"color-black\",\n \"borderRadius\": 8,\n \"borderWidth\": \"1px\",\n \"borderStyle\": \"solid\"\n },\n \"field\": {\n \"color\": \"color-black\",\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontStyle\": \"normal\",\n \"letterSpacing\": \"-0.01em\"\n },\n \"label\": {\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontWeight\": 600,\n \"letterSpacing\": \"-0.01em\",\n \"textTransform\": \"none\",\n \"fontStyle\": \"normal\"\n },\n \"helperText\": {}\n }\n },\n \"textarea\": {\n \"size\": \"md\",\n \"shape\": \"default\",\n \"variant\": \"default\",\n \"views\": {\n \"container\": {\n \"backgroundColor\": \"color-white\",\n \"borderColor\": \"color-gray-200\",\n \"color\": \"color-black\",\n \"borderRadius\": 8,\n \"borderWidth\": \"1px\",\n \"borderStyle\": \"solid\"\n },\n \"field\": {\n \"color\": \"color-black\",\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontStyle\": \"normal\",\n \"letterSpacing\": \"-0.01em\"\n },\n \"label\": {\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontWeight\": 600,\n \"letterSpacing\": \"-0.01em\",\n \"textTransform\": \"none\",\n \"fontStyle\": \"normal\"\n },\n \"helperText\": {}\n }\n },\n \"select\": {\n \"size\": \"md\",\n \"shape\": \"default\",\n \"variant\": \"default\",\n \"views\": {\n \"container\": {\n \"backgroundColor\": \"color-white\",\n \"borderColor\": \"color-gray-200\",\n \"color\": \"color-black\",\n \"borderRadius\": 8,\n \"borderWidth\": \"1px\",\n \"borderStyle\": \"solid\"\n },\n \"field\": {\n \"color\": \"color-black\",\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\"\n },\n \"label\": {\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontWeight\": 600,\n \"letterSpacing\": \"-0.01em\",\n \"textTransform\": \"none\",\n \"fontStyle\": \"normal\"\n },\n \"helperText\": {},\n \"text\": {\n \"letterSpacing\": \"-0.01em\",\n \"fontStyle\": \"normal\"\n }\n }\n },\n \"checkbox\": {\n \"size\": \"md\",\n \"views\": {\n \"checkbox\": {\n \"borderColor\": \"color-gray-200\",\n \"backgroundColor\": \"color-white\",\n \"_checked\": {\n \"backgroundColor\": \"theme-primary\",\n \"borderColor\": \"theme-primary\"\n },\n \"borderRadius\": 4\n },\n \"label\": {\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontWeight\": 600,\n \"letterSpacing\": \"-0.01em\",\n \"textTransform\": \"none\",\n \"fontStyle\": \"normal\"\n },\n \"infoText\": {\n \"color\": \"color-gray-500\"\n },\n \"container\": {\n \"borderRadius\": 4\n }\n }\n },\n \"radio\": {\n \"size\": \"md\",\n \"views\": {\n \"radio\": {\n \"borderColor\": \"color-gray-200\",\n \"backgroundColor\": \"color-white\"\n },\n \"dot\": {\n \"backgroundColor\": \"theme-primary\"\n },\n \"label\": {\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontWeight\": 600,\n \"letterSpacing\": \"-0.01em\",\n \"textTransform\": \"none\",\n \"fontStyle\": \"normal\"\n },\n \"infoText\": {\n \"color\": \"color-gray-500\"\n },\n \"container\": {\n \"borderRadius\": \"50%\"\n }\n }\n },\n \"switch\": {\n \"size\": \"sm\",\n \"views\": {\n \"slider\": {\n \"backgroundColor\": \"color-gray-200\"\n },\n \"circle\": {\n \"backgroundColor\": \"color-white\"\n },\n \"label\": {\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontWeight\": 600,\n \"letterSpacing\": \"-0.01em\",\n \"textTransform\": \"none\",\n \"fontStyle\": \"normal\"\n },\n \"container\": {\n \"borderRadius\": \"9999px\"\n }\n }\n },\n \"slider\": {\n \"backgroundColor\": \"theme-primary\",\n \"views\": {\n \"track\": {\n \"backgroundColor\": \"color-gray-200\"\n },\n \"progress\": {\n \"backgroundColor\": \"theme-primary\"\n },\n \"filledTrack\": {\n \"backgroundColor\": \"theme-primary\"\n },\n \"thumb\": {\n \"borderColor\": \"theme-primary\",\n \"backgroundColor\": \"color-white\"\n },\n \"label\": {\n \"color\": \"color-black\"\n },\n \"valueLabel\": {\n \"color\": \"color-gray-500\"\n }\n }\n },\n \"tabs\": {\n \"variant\": \"underline\",\n \"views\": {\n \"headerTabs\": {\n \"borderColor\": \"color-gray-200\"\n },\n \"tab\": {\n \"color\": \"color-gray-500\",\n \"fontWeight\": 600,\n \"letterSpacing\": \"-0.01em\",\n \"textTransform\": \"none\",\n \"fontStyle\": \"normal\"\n },\n \"activeTab\": {\n \"color\": \"theme-primary\",\n \"borderColor\": \"theme-primary\",\n \"backgroundColor\": \"transparent\"\n },\n \"title\": {\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\"\n },\n \"activeText\": {\n \"color\": \"theme-primary\"\n },\n \"content\": {\n \"color\": \"color-black\"\n },\n \"container\": {\n \"borderRadius\": \"8px\"\n }\n }\n },\n \"accordion\": {\n \"views\": {\n \"container\": {\n \"borderColor\": \"color-gray-200\",\n \"backgroundColor\": \"color-gray-50\",\n \"color\": \"color-black\",\n \"borderRadius\": \"12px\"\n },\n \"trigger\": {\n \"color\": \"color-black\",\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\"\n },\n \"content\": {\n \"color\": \"color-gray-500\"\n }\n }\n },\n \"table\": {\n \"views\": {\n \"table\": {\n \"backgroundColor\": \"color-white\",\n \"color\": \"color-black\",\n \"borderColor\": \"color-gray-200\",\n \"borderRadius\": 12\n },\n \"thead\": {\n \"backgroundColor\": \"color-gray-50\",\n \"color\": \"color-black\"\n },\n \"th\": {\n \"color\": \"color-gray-500\",\n \"borderColor\": \"color-gray-200\",\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontWeight\": 600,\n \"letterSpacing\": \"-0.01em\",\n \"textTransform\": \"none\",\n \"fontStyle\": \"normal\"\n },\n \"tr\": {\n \"borderColor\": \"color-gray-200\"\n },\n \"td\": {\n \"color\": \"color-black\",\n \"borderColor\": \"color-gray-200\",\n \"letterSpacing\": \"-0.01em\",\n \"fontStyle\": \"normal\"\n },\n \"caption\": {\n \"color\": \"color-gray-500\",\n \"fontStyle\": \"italic\",\n \"letterSpacing\": \"-0.01em\"\n }\n }\n },\n \"avatar\": {\n \"views\": {\n \"container\": {\n \"backgroundColor\": \"color-gray-50\",\n \"borderColor\": \"color-gray-200\",\n \"color\": \"color-black\",\n \"borderRadius\": \"50%\"\n },\n \"fallback\": {\n \"color\": \"color-black\",\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\"\n }\n }\n },\n \"alert\": {\n \"views\": {\n \"container\": {\n \"borderRadius\": 12\n },\n \"title\": {\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\",\n \"fontWeight\": 700,\n \"letterSpacing\": \"-0.01em\",\n \"textTransform\": \"none\",\n \"fontStyle\": \"normal\"\n },\n \"description\": {\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\"\n }\n }\n },\n \"status\": {\n \"views\": {\n \"label\": {\n \"color\": \"color-black\",\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\"\n }\n }\n },\n \"progress\": {\n \"color\": \"theme-primary\",\n \"backgroundColor\": \"color-gray-200\",\n \"radius\": \"9999px\",\n \"views\": {\n \"container\": {\n \"backgroundColor\": \"color-gray-200\",\n \"borderRadius\": \"9999px\"\n },\n \"bar\": {\n \"backgroundColor\": \"theme-primary\"\n },\n \"text\": {\n \"color\": \"color-black\"\n }\n }\n },\n \"loader\": {\n \"color\": \"theme-primary\"\n },\n \"separator\": {\n \"color\": \"color-gray-200\",\n \"views\": {\n \"container\": {\n \"borderColor\": \"color-gray-200\"\n },\n \"label\": {\n \"color\": \"color-gray-500\",\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\"\n }\n }\n },\n \"navigation\": {\n \"views\": {\n \"container\": {\n \"backgroundColor\": \"color-white\",\n \"borderColor\": \"color-gray-200\",\n \"color\": \"color-black\",\n \"borderRadius\": \"12px\"\n },\n \"item\": {\n \"color\": \"color-gray-500\"\n },\n \"activeItem\": {\n \"color\": \"theme-primary\",\n \"borderColor\": \"theme-primary\"\n }\n }\n },\n \"hero\": {\n \"views\": {\n \"container\": {\n \"backgroundColor\": \"color-white\",\n \"color\": \"color-black\",\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\"\n },\n \"eyebrow\": {\n \"color\": \"color-gray-500\"\n },\n \"title\": {\n \"color\": \"color-black\",\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\"\n },\n \"description\": {\n \"color\": \"color-gray-500\"\n }\n }\n },\n \"page\": {\n \"views\": {\n \"container\": {\n \"backgroundColor\": \"color-white\",\n \"color\": \"color-black\",\n \"fontFamily\": \"'Inter', system-ui, -apple-system, sans-serif\"\n },\n \"section\": {\n \"backgroundColor\": \"color-white\",\n \"borderColor\": \"color-gray-200\"\n },\n \"surface\": {\n \"backgroundColor\": \"color-gray-50\",\n \"borderColor\": \"color-gray-200\",\n \"color\": \"color-black\"\n }\n }\n }\n },\n \"personality\": {\n \"cornerStyle\": \"soft\",\n \"typeWeight\": \"regular\",\n \"typeCase\": \"normal\",\n \"typeStyle\": \"normal\",\n \"letterSpacing\": \"-0.01em\",\n \"accentTreatment\": \"flat\",\n \"signatureMotif\": \"●\",\n \"density\": \"comfortable\",\n \"surfaceTone\": \"paper\",\n \"cardRadius\": 12,\n \"pillRadius\": 9999,\n \"badgeRadius\": 6,\n \"voice\": \"neutral-clear\"\n }\n}\n",
|
|
43
|
+
"type": "registry:lib"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"path": "src/design-system/DesignSystemScope.native.tsx",
|
|
47
|
+
"content": "import React from 'react';\nimport { DesignSystemScopeProps } from './types';\n\n/**\n * DesignSystemScope (native): React Native has no CSS selectors to mark the\n * subtree for, and a web `<div>` crashes the renderer, so the children render\n * as they are.\n */\nexport const DesignSystemScope: React.FC<DesignSystemScopeProps> = ({\n children,\n}) => <>{children}</>;\n",
|
|
48
|
+
"type": "registry:lib"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"path": "src/design-system/DesignSystemScope.tsx",
|
|
52
|
+
"content": "import React from 'react';\nimport { DesignSystemScopeProps } from './types';\n\n/**\n * Marks the design system's subtree for CSS (`[data-design-system]`,\n * `[data-appearance]`) without adding a layout box. Native twin:\n * DesignSystemScope.native, which has no DOM to mark.\n */\nexport const DesignSystemScope: React.FC<DesignSystemScopeProps> = ({\n children,\n id,\n appearance,\n}) => (\n <div\n data-design-system={id}\n data-appearance={appearance}\n style={{ display: 'contents' }}\n >\n {children}\n </div>\n);\n",
|
|
53
|
+
"type": "registry:lib"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"path": "src/design-system/theme.tsx",
|
|
57
|
+
"content": "import React, {\n Context,\n createContext,\n ReactNode,\n useContext,\n useMemo,\n} from 'react';\nimport { ThemeProvider, useTheme } from 'app-studio';\nimport defaultConfig from './configs/default.json';\nimport { DesignSystemScope } from './DesignSystemScope';\nimport {\n DesignSystemAppearance,\n DesignSystemComponentConfigFor,\n DesignSystemComponentName,\n DesignSystemConfig,\n DesignSystemContextValue,\n DesignSystemStylePrecedence,\n} from './types';\nimport {\n getDesignSystemComponentProps,\n mergeComponentDefaults,\n mergeDesignSystemComponentProps,\n} from './utils';\n\nconst contextKey = Symbol.for(\n '@app-studio/components/design-system-context/v1'\n);\n\nfunction getDesignSystemContext() {\n // A copied theme and the npm entry can coexist in one React tree. Share the\n // context for that React runtime. Provider values still live in the tree.\n const scope = globalThis as typeof globalThis & {\n [contextKey]?: WeakMap<\n typeof createContext,\n Context<DesignSystemContextValue>\n >;\n };\n const contexts = (scope[contextKey] ??= new WeakMap());\n const existing = contexts.get(createContext);\n if (existing) return existing;\n\n const context = createContext<DesignSystemContextValue>({ isEnabled: false });\n contexts.set(createContext, context);\n return context;\n}\n\nconst DesignSystemContext = getDesignSystemContext();\n\nexport interface DesignSystemProviderProps {\n children: ReactNode;\n config?: DesignSystemConfig;\n /**\n * Explicitly pin the appearance for this subtree (light/dark). When omitted,\n * the provider follows the **global** theme mode (so a light/dark toggle\n * flips the design system), falling back to the config's `defaultAppearance`\n * only when there is no surrounding ThemeProvider.\n */\n mode?: DesignSystemAppearance;\n /** Document that owns the subtree and its theme stylesheet (for iframe portals). */\n targetWindow?: Window;\n /**\n * Render no ThemeProvider of its own: colours and mode come from the\n * surrounding ThemeProvider (an app's `brand`), and this provider only\n * supplies the component configuration. Without it (the default), the\n * config's `theme` is applied through a nested ThemeProvider.\n */\n inheritTheme?: boolean;\n /** Standard precedence applies theme defaults, then variant styles, then instance overrides. */\n stylePrecedence?: DesignSystemStylePrecedence;\n}\n\nexport const DesignSystemProvider: React.FC<DesignSystemProviderProps> = ({\n children,\n config,\n mode,\n targetWindow,\n inheritTheme = false,\n stylePrecedence = 'standard',\n}) => {\n const resolvedConfig = config ?? (defaultConfig as DesignSystemConfig);\n\n // Follow the active global theme mode so a light/dark toggle actually flips\n // the design system. An explicit `mode` prop pins the subtree; otherwise we\n // inherit the surrounding ThemeProvider's mode and fall back to the config's\n // declared default appearance when no provider is present.\n const { themeMode } = useTheme();\n const effectiveMode: DesignSystemAppearance =\n mode ?? themeMode ?? resolvedConfig.metadata.defaultAppearance;\n const theme = useMemo(\n () => ({ ...resolvedConfig.theme }),\n [resolvedConfig.theme]\n );\n const themeOptions = {\n mode: effectiveMode,\n targetWindow,\n transparentWrapper: true,\n };\n\n const value = useMemo(\n () => ({\n config: resolvedConfig,\n configId: resolvedConfig.metadata.id,\n isEnabled: true,\n stylePrecedence,\n }),\n [resolvedConfig, stylePrecedence]\n );\n\n // Delegate token resolution to app-studio's ThemeProvider: it emits\n // `--theme-<slot>` CSS variables from the theme object and registers them\n // with its color resolver, so `theme-primary`, `theme-canvas`, etc. work\n // anywhere a component uses them. `transparentWrapper` is auto-inferred\n // (nested under another ThemeProvider) and keeps the page layout intact.\n const scoped = (\n <DesignSystemScope\n id={resolvedConfig.metadata.id}\n appearance={effectiveMode}\n >\n {children}\n </DesignSystemScope>\n );\n\n if (inheritTheme) {\n return (\n <DesignSystemContext.Provider value={value}>\n {scoped}\n </DesignSystemContext.Provider>\n );\n }\n\n return (\n <DesignSystemContext.Provider value={value}>\n <ThemeProvider theme={theme} {...themeOptions}>\n {scoped}\n </ThemeProvider>\n </DesignSystemContext.Provider>\n );\n};\n\nexport const useDesignSystem = () => useContext(DesignSystemContext);\n\nexport const useDesignSystemComponentProps = <\n Name extends DesignSystemComponentName\n>(\n componentName: Name\n): DesignSystemComponentConfigFor<Name> => {\n const { config, stylePrecedence } = useDesignSystem();\n return getDesignSystemComponentProps(\n componentName,\n config,\n stylePrecedence\n ) as DesignSystemComponentConfigFor<Name>;\n};\n\nexport const useMergedDesignSystemComponentProps = <\n T extends Record<string, any>\n>(\n componentName: DesignSystemComponentName,\n props: T\n): T => {\n const { config } = useDesignSystem();\n return mergeDesignSystemComponentProps(componentName, props, config);\n};\n\n/** Keep theme views separate until the component knows which variant to apply. */\nexport function useDesignSystemComponentLayers<\n T extends { views?: Record<string, any> }\n>(\n componentName: DesignSystemComponentName,\n props: T\n): { props: T; themeViews?: T['views'] } {\n const { config, stylePrecedence } = useDesignSystem();\n const defaults = getDesignSystemComponentProps(\n componentName,\n config,\n stylePrecedence\n );\n if (stylePrecedence !== 'standard') {\n return { props: mergeComponentDefaults(defaults, props) };\n }\n const { views, ...otherDefaults } = defaults;\n return {\n props: mergeComponentDefaults(otherDefaults, props),\n themeViews: (views ?? {}) as T['views'],\n };\n}\n\nexport * from './types';\nexport * from './utils';\n",
|
|
58
|
+
"type": "registry:lib"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"path": "src/design-system/types.ts",
|
|
62
|
+
"content": "import type { ReactNode } from 'react';\n\nexport type DesignSystemAppearance = 'light' | 'dark';\nexport type DesignSystemStylePrecedence = 'standard' | 'legacy';\n\n/** Augment this interface from the package's theme entry to register your components. */\nexport interface DesignSystemComponentRegistry {}\n\nexport type DesignSystemComponentName =\n | Extract<keyof DesignSystemComponentRegistry, string>\n | 'accordion'\n | 'alert'\n | 'avatar'\n | 'badge'\n | 'button'\n | 'card'\n | 'checkbox'\n | 'hero'\n | 'input'\n | 'loader'\n | 'navigation'\n | 'page'\n | 'pageHeader'\n | 'progress'\n | 'radio'\n | 'select'\n | 'separator'\n | 'slider'\n | 'statePanel'\n | 'status'\n | 'switch'\n | 'table'\n | 'tabs'\n | 'textarea';\n\nexport type DesignSystemViewProps = Record<string, any>;\n\nexport interface DesignSystemMetadata {\n id: string;\n label: string;\n sourcePath: string;\n sourceTitle: string;\n defaultAppearance: DesignSystemAppearance;\n googleFontLinks?: string[];\n}\n\n/**\n * The eleven semantic theme slots. A single config serves **both** light and\n * dark mode — the dark theme is derived automatically by app-studio's\n * ThemeProvider. The *form* of each value decides how the slot behaves when\n * the theme mode switches:\n *\n * - A **`color-*` token** (`\"color-black\"`) is emitted as\n * `--theme-<slot>: var(--color-black)` and **flips automatically**:\n * `color-black` → black in light / white in dark, `color-white` → black in\n * dark, and the `color-gray-*` ramp inverts. Use it for structural neutrals.\n * - A **parseable literal** (`\"#2563eb\"`, `rgb(...)`) is **snapped to the\n * nearest palette token** (`normalizeThemeColors` in app-studio), so it\n * also adapts to dark mode — brand hexes get the dark-mode variant of the\n * closest palette shade rather than staying frozen.\n * - An **unparseable literal** (a CSS named colour, a gradient) stays\n * constant across modes. For the neutral slots (canvas, surface, text,\n * muted, border) app-studio warns about this in development, because a\n * frozen neutral reads as a dark-mode regression.\n *\n * Rule of thumb: **use `color-*` tokens for the structural neutrals (canvas,\n * text, surface, muted, border) and hex for brand accents (primary,\n * secondary, states) — knowing the hex will be palette-snapped so it stays\n * legible in dark mode.** See `docs/design-system/theming.md` §2.1.\n */\nexport interface DesignSystemTheme {\n /** Brand primary (CTAs, links, focus). Constant → use a **hex**. */\n primary: string;\n /** Brand secondary accent. Constant → use a **hex** (not for body ink). */\n secondary: string;\n /** Positive state. Constant → use a **hex**. */\n success: string;\n /** Caution / pending state. Constant → use a **hex**. */\n warning: string;\n /** Destructive / failure state. Constant → use a **hex**. */\n error: string;\n /** Page background. Adaptive → use a **`color-*` token** (e.g. `color-white`). */\n canvas: string;\n /** Card / elevated surface. Adaptive → use a **`color-*` token** (e.g. `color-gray-50`). */\n surface: string;\n /** Primary ink / body copy. Adaptive → use a **`color-*` token** (e.g. `color-black`). */\n text: string;\n /** Secondary ink (captions, helper). Adaptive → use a **`color-*` token** (e.g. `color-gray-500`). */\n muted: string;\n /** Hairlines, dividers, control borders. Adaptive → use a **`color-*` token** (e.g. `color-gray-200`). */\n border: string;\n /** Ink on top of `primary` (button label). Constant → use a **hex** (usually `#ffffff`). */\n onPrimary: string;\n}\n\nexport interface DesignSystemColorToken {\n name: string;\n value: string;\n role: string;\n}\n\nexport interface DesignSystemTypographyTokens {\n fontFamily: string;\n monoFamily: string;\n fontSizes: string[];\n fontWeights: string[];\n lineHeights: string[];\n}\n\nexport interface DesignSystemTokens {\n rawCssVars: Record<string, string>;\n colors: DesignSystemColorToken[];\n typography: DesignSystemTypographyTokens;\n spacing: string[];\n radii: string[];\n shadows: string[];\n}\n\nexport interface DesignSystemComponentConfig extends Record<string, any> {\n /** Per-slot defaults. Standard precedence applies the selected variant on top. */\n views?: Record<string, DesignSystemViewProps>;\n config?: Record<string, any>;\n}\n\nexport type BrandCornerStyle = 'sharp' | 'soft' | 'pill';\nexport type BrandTypeWeight = 'light' | 'regular' | 'bold' | 'black';\nexport type BrandTypeCase = 'normal' | 'uppercase';\nexport type BrandTypeStyle = 'normal' | 'italic';\nexport type BrandAccentTreatment =\n | 'flat'\n | 'gradient'\n | 'stripe'\n | 'glow'\n | 'halftone';\nexport type BrandDensity = 'tight' | 'comfortable' | 'spacious';\nexport type BrandSurfaceTone = 'paper' | 'glass' | 'matte' | 'mono';\n\nexport interface BrandPersonality {\n cornerStyle: BrandCornerStyle;\n typeWeight: BrandTypeWeight;\n typeCase: BrandTypeCase;\n typeStyle: BrandTypeStyle;\n letterSpacing: string;\n accentTreatment: BrandAccentTreatment;\n signatureMotif: string;\n density: BrandDensity;\n surfaceTone: BrandSurfaceTone;\n cardRadius: number;\n pillRadius: number;\n badgeRadius: number;\n voice: string;\n}\n\nexport type DesignSystemComponentConfigFor<\n Name extends DesignSystemComponentName\n> = Name extends keyof DesignSystemComponentRegistry\n ? DesignSystemComponentRegistry[Name]\n : DesignSystemComponentConfig;\n\nexport interface DesignSystemConfig {\n metadata: DesignSystemMetadata;\n theme: DesignSystemTheme;\n tokens: DesignSystemTokens;\n components: {\n [Name in DesignSystemComponentName]?: DesignSystemComponentConfigFor<Name>;\n };\n personality?: BrandPersonality;\n}\n\nexport interface DesignSystemContextValue {\n config?: DesignSystemConfig;\n configId?: string;\n isEnabled: boolean;\n stylePrecedence?: DesignSystemStylePrecedence;\n}\n\nexport interface DesignSystemScopeProps {\n children: ReactNode;\n id: string;\n appearance: DesignSystemAppearance;\n}\n",
|
|
63
|
+
"type": "registry:lib"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"path": "src/design-system/utils.ts",
|
|
67
|
+
"content": "import {\n DesignSystemComponentConfig,\n DesignSystemComponentName,\n DesignSystemConfig,\n DesignSystemStylePrecedence,\n} from './types';\n\nconst isPlainObject = (value: unknown): value is Record<string, any> =>\n Boolean(value) &&\n typeof value === 'object' &&\n !Array.isArray(value) &&\n Object.prototype.toString.call(value) === '[object Object]';\n\nexport const normalizeDesignSystemComponentProps = <\n T extends Record<string, any>\n>(\n props: T\n): T => {\n return props;\n};\n\nexport const deepMerge = <T extends Record<string, any> = Record<string, any>>(\n ...objects: Array<Record<string, any> | undefined>\n): T => {\n const result: Record<string, any> = {};\n\n objects.forEach((object) => {\n if (!isPlainObject(object)) return;\n\n Object.entries(object).forEach(([key, value]) => {\n // Treat null the same as undefined: configs use null to declare a key\n // exists in the schema without overriding component defaults. Nested\n // nulls (e.g. `views.container.backgroundColor: null`) are pre-stripped\n // from configs at the boundary — see `stripNullsDeep` below — so this\n // top-level check is sufficient and we keep the cycle-safe shape that\n // assigns React-element props by reference rather than recursing.\n if (value === undefined || value === null) return;\n\n if (isPlainObject(value) && isPlainObject(result[key])) {\n result[key] = deepMerge(result[key], value);\n return;\n }\n\n result[key] = value;\n });\n });\n\n return result as T;\n};\n\n/** Merge slots in order, including styles supplied through the engine's inline style prop. */\nexport function mergeDesignSystemViews<T extends Record<string, any>>(\n ...layers: Array<Partial<T> | undefined>\n): T {\n const result: Record<string, any> = {};\n for (const layer of layers) {\n for (const [slot, view] of Object.entries(layer ?? {})) {\n if (!isPlainObject(view)) continue;\n // React Native styles can include nested arrays of objects and false values.\n const next = Array.isArray(view.style)\n ? {\n ...view,\n style: Object.assign(\n {},\n ...view.style.flat(Infinity).filter(isPlainObject)\n ),\n }\n : view;\n const previous = result[slot];\n if (isPlainObject(previous?.style)) {\n const style = { ...previous.style };\n // The engine applies inline styles after style props. Remove an earlier\n // inline value when a higher-priority layer sets the same direct prop.\n for (const [key, value] of Object.entries(next)) {\n if (key !== 'style' && value != null) delete style[key];\n }\n result[slot] = deepMerge({ ...previous, style }, next);\n } else {\n result[slot] = deepMerge(previous, next);\n }\n }\n }\n return result as T;\n}\n\n// Recursively remove keys whose value is `null` from plain-object trees.\n// Only descends into plain objects: arrays and non-object values are returned\n// as-is, so React elements / fibers / class instances are left alone. Used to\n// scrub `views.container.backgroundColor: null` and friends from configs\n// before they ever reach the merge pipeline.\nconst stripNullsDeep = <T>(value: T): T => {\n if (Array.isArray(value)) return value;\n if (!isPlainObject(value)) return value;\n const out: Record<string, any> = {};\n for (const [k, v] of Object.entries(value)) {\n if (v === null) continue;\n out[k] = isPlainObject(v) ? stripNullsDeep(v) : v;\n }\n return out as T;\n};\n\n// Components whose colors are computed per-variant. A config block's `views`\n// sits ABOVE the variant palette, so a color there flattens every variant\n// (ghost/outline/subtle all render as solid blocks). Colors for these\n// components belong in `config.variants.<variant>` or the top-level\n// `color`/`textColor` keys. Retain this warning for legacy precedence.\nconst VARIANT_DRIVEN_COMPONENTS: ReadonlySet<string> = new Set(['button']);\nconst VIEW_COLOR_KEYS = [\n 'backgroundColor',\n 'background',\n 'borderColor',\n 'color',\n] as const;\nconst warnedViewColorBlocks = new Set<string>();\n\nconst warnOnViewColors = (\n componentName: string,\n views: Record<string, Record<string, unknown>> | undefined\n) => {\n if (process.env.NODE_ENV === 'production') return;\n if (!views || !VARIANT_DRIVEN_COMPONENTS.has(componentName)) return;\n if (warnedViewColorBlocks.has(componentName)) return;\n for (const [viewKey, viewValue] of Object.entries(views)) {\n if (!isPlainObject(viewValue)) continue;\n const offenders = VIEW_COLOR_KEYS.filter((k) => viewValue[k] != null);\n if (offenders.length > 0) {\n warnedViewColorBlocks.add(componentName);\n console.warn(\n `[design-system] components.${componentName}.views.${viewKey} sets ` +\n `${offenders.join(', ')} — view styles apply above every variant, ` +\n 'so this flattens ghost/outline/subtle into solid blocks. Move ' +\n `colors to components.${componentName}.config.variants.<variant> ` +\n 'for an individual variant; keep legacy views to shape and typography.'\n );\n return;\n }\n }\n};\n\nexport const getDesignSystemComponentProps = (\n componentName: DesignSystemComponentName,\n config?: DesignSystemConfig,\n stylePrecedence: DesignSystemStylePrecedence = 'legacy'\n): DesignSystemComponentConfig => {\n if (!config) return {};\n const raw: DesignSystemComponentConfig =\n config.components[componentName] || {};\n const cleaned = normalizeDesignSystemComponentProps(stripNullsDeep(raw));\n if (stylePrecedence === 'legacy')\n warnOnViewColors(componentName, cleaned.views);\n return cleaned;\n};\n\nexport const mergeDesignSystemComponentProps = <T extends Record<string, any>>(\n componentName: DesignSystemComponentName,\n props: T,\n config?: DesignSystemConfig\n): T =>\n mergeComponentDefaults(\n getDesignSystemComponentProps(componentName, config),\n props\n );\n\nexport function mergeComponentDefaults<T extends Record<string, any>>(\n defaults: DesignSystemComponentConfig,\n props: T\n): T {\n const { config: localConfig, ...otherProps } = props;\n return normalizeDesignSystemComponentProps(\n deepMerge<T>(defaults, localConfig, otherProps)\n );\n}\n",
|
|
68
|
+
"type": "registry:lib"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
package/dist/select.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Select-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Select-DRMUC3NX.cjs");exports.Select=e.Select;
|
|
2
2
|
//# sourceMappingURL=select.cjs.js.map
|
package/dist/select.esm.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("app-studio"),t=require("./chunks/Card-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("app-studio"),t=require("./chunks/Card-CK_D7gzP.cjs"),s=require("./chunks/Select-DRMUC3NX.cjs"),c=require("./chunks/Switch-DqgmPp8M.cjs"),o=[{label:"System",value:"system"},{label:"Light",value:"light"},{label:"Dark",value:"dark"}];function d({appearance:r,notifications:a,onAppearanceChange:i,onNotificationsChange:l}){return e.jsxs(t.Card,{children:[e.jsx(t.Card.Header,{children:e.jsx(n.Text,{fontWeight:"bold",color:"theme-text",children:"Settings"})}),e.jsx(t.Card.Content,{children:e.jsxs(n.Vertical,{gap:12,children:[e.jsx(s.Select,{label:"Appearance",options:o,value:r,onChange:i}),e.jsx(c.Switch,{label:"Notifications",isChecked:a,onChange:l})]})})]})}exports.SettingsPanel=d;
|
|
2
2
|
//# sourceMappingURL=settings-panel.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-panel.cjs.js","sources":["../src/components/pilot/blocks/SettingsPanel.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, Vertical } from 'app-studio';\nimport { Card } from '../card';\nimport { Select } from '../select';\nimport { Switch } from '../switch';\n\nconst appearances = [\n { label: 'System', value: 'system' },\n { label: 'Light', value: 'light' },\n { label: 'Dark', value: 'dark' },\n];\n\nexport interface SettingsPanelProps {\n appearance: string;\n notifications: boolean;\n onAppearanceChange: (appearance: string) => void;\n onNotificationsChange: (enabled: boolean) => void;\n}\n\nexport function SettingsPanel({\n appearance,\n notifications,\n onAppearanceChange,\n onNotificationsChange,\n}: SettingsPanelProps) {\n return (\n <Card>\n <Card.Header>\n <Text fontWeight=\"bold\"
|
|
1
|
+
{"version":3,"file":"settings-panel.cjs.js","sources":["../src/components/pilot/blocks/SettingsPanel.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, Vertical } from 'app-studio';\nimport { Card } from '../card';\nimport { Select } from '../select';\nimport { Switch } from '../switch';\n\nconst appearances = [\n { label: 'System', value: 'system' },\n { label: 'Light', value: 'light' },\n { label: 'Dark', value: 'dark' },\n];\n\nexport interface SettingsPanelProps {\n appearance: string;\n notifications: boolean;\n onAppearanceChange: (appearance: string) => void;\n onNotificationsChange: (enabled: boolean) => void;\n}\n\nexport function SettingsPanel({\n appearance,\n notifications,\n onAppearanceChange,\n onNotificationsChange,\n}: SettingsPanelProps) {\n return (\n <Card>\n <Card.Header>\n <Text fontWeight=\"bold\" color=\"theme-text\">\n Settings\n </Text>\n </Card.Header>\n <Card.Content>\n <Vertical gap={12}>\n <Select\n label=\"Appearance\"\n options={appearances}\n value={appearance}\n onChange={onAppearanceChange}\n />\n <Switch\n label=\"Notifications\"\n isChecked={notifications}\n onChange={onNotificationsChange}\n />\n </Vertical>\n </Card.Content>\n </Card>\n );\n}\n"],"names":["appearances","SettingsPanel","appearance","notifications","onAppearanceChange","onNotificationsChange","Card","jsx","Text","jsxs","Vertical","Select","Switch"],"mappings":"yQAMMA,EAAc,CAClB,CAAE,MAAO,SAAU,MAAO,QAAA,EAC1B,CAAE,MAAO,QAAS,MAAO,OAAA,EACzB,CAAE,MAAO,OAAQ,MAAO,MAAA,CAC1B,EASO,SAASC,EAAc,CAC5B,WAAAC,EACA,cAAAC,EACA,mBAAAC,EACA,sBAAAC,CACF,EAAuB,CACrB,cACGC,OAAA,CACC,SAAA,CAAAC,EAAAA,IAACD,EAAAA,KAAK,OAAL,CACC,SAAAC,EAAAA,IAACC,EAAAA,KAAA,CAAK,WAAW,OAAO,MAAM,aAAa,SAAA,UAAA,CAE3C,CAAA,CACF,QACCF,EAAAA,KAAK,QAAL,CACC,SAAAG,OAACC,EAAAA,SAAA,CAAS,IAAK,GACb,SAAA,CAAAH,EAAAA,IAACI,EAAAA,OAAA,CACC,MAAM,aACN,QAASX,EACT,MAAOE,EACP,SAAUE,CAAA,CAAA,EAEZG,EAAAA,IAACK,EAAAA,OAAA,CACC,MAAM,gBACN,UAAWT,EACX,SAAUE,CAAA,CAAA,CACZ,CAAA,CACF,CAAA,CACF,CAAA,EACF,CAEJ"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Text as
|
|
3
|
-
import { C as t } from "./chunks/Card-
|
|
4
|
-
import { S as c } from "./chunks/Select-
|
|
5
|
-
import { S as h } from "./chunks/Switch-
|
|
2
|
+
import { Text as n, Vertical as s } from "app-studio";
|
|
3
|
+
import { C as t } from "./chunks/Card-ymI5Thma.mjs";
|
|
4
|
+
import { S as c } from "./chunks/Select-CrOxhfvQ.mjs";
|
|
5
|
+
import { S as h } from "./chunks/Switch-04GGHGrV.mjs";
|
|
6
6
|
const m = [
|
|
7
7
|
{ label: "System", value: "system" },
|
|
8
8
|
{ label: "Light", value: "light" },
|
|
@@ -11,11 +11,11 @@ const m = [
|
|
|
11
11
|
function b({
|
|
12
12
|
appearance: r,
|
|
13
13
|
notifications: l,
|
|
14
|
-
onAppearanceChange:
|
|
15
|
-
onNotificationsChange:
|
|
14
|
+
onAppearanceChange: o,
|
|
15
|
+
onNotificationsChange: i
|
|
16
16
|
}) {
|
|
17
17
|
return /* @__PURE__ */ a(t, { children: [
|
|
18
|
-
/* @__PURE__ */ e(t.Header, { children: /* @__PURE__ */ e(
|
|
18
|
+
/* @__PURE__ */ e(t.Header, { children: /* @__PURE__ */ e(n, { fontWeight: "bold", color: "theme-text", children: "Settings" }) }),
|
|
19
19
|
/* @__PURE__ */ e(t.Content, { children: /* @__PURE__ */ a(s, { gap: 12, children: [
|
|
20
20
|
/* @__PURE__ */ e(
|
|
21
21
|
c,
|
|
@@ -23,7 +23,7 @@ function b({
|
|
|
23
23
|
label: "Appearance",
|
|
24
24
|
options: m,
|
|
25
25
|
value: r,
|
|
26
|
-
onChange:
|
|
26
|
+
onChange: o
|
|
27
27
|
}
|
|
28
28
|
),
|
|
29
29
|
/* @__PURE__ */ e(
|
|
@@ -31,7 +31,7 @@ function b({
|
|
|
31
31
|
{
|
|
32
32
|
label: "Notifications",
|
|
33
33
|
isChecked: l,
|
|
34
|
-
onChange:
|
|
34
|
+
onChange: i
|
|
35
35
|
}
|
|
36
36
|
)
|
|
37
37
|
] }) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-panel.esm.mjs","sources":["../src/components/pilot/blocks/SettingsPanel.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, Vertical } from 'app-studio';\nimport { Card } from '../card';\nimport { Select } from '../select';\nimport { Switch } from '../switch';\n\nconst appearances = [\n { label: 'System', value: 'system' },\n { label: 'Light', value: 'light' },\n { label: 'Dark', value: 'dark' },\n];\n\nexport interface SettingsPanelProps {\n appearance: string;\n notifications: boolean;\n onAppearanceChange: (appearance: string) => void;\n onNotificationsChange: (enabled: boolean) => void;\n}\n\nexport function SettingsPanel({\n appearance,\n notifications,\n onAppearanceChange,\n onNotificationsChange,\n}: SettingsPanelProps) {\n return (\n <Card>\n <Card.Header>\n <Text fontWeight=\"bold\"
|
|
1
|
+
{"version":3,"file":"settings-panel.esm.mjs","sources":["../src/components/pilot/blocks/SettingsPanel.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, Vertical } from 'app-studio';\nimport { Card } from '../card';\nimport { Select } from '../select';\nimport { Switch } from '../switch';\n\nconst appearances = [\n { label: 'System', value: 'system' },\n { label: 'Light', value: 'light' },\n { label: 'Dark', value: 'dark' },\n];\n\nexport interface SettingsPanelProps {\n appearance: string;\n notifications: boolean;\n onAppearanceChange: (appearance: string) => void;\n onNotificationsChange: (enabled: boolean) => void;\n}\n\nexport function SettingsPanel({\n appearance,\n notifications,\n onAppearanceChange,\n onNotificationsChange,\n}: SettingsPanelProps) {\n return (\n <Card>\n <Card.Header>\n <Text fontWeight=\"bold\" color=\"theme-text\">\n Settings\n </Text>\n </Card.Header>\n <Card.Content>\n <Vertical gap={12}>\n <Select\n label=\"Appearance\"\n options={appearances}\n value={appearance}\n onChange={onAppearanceChange}\n />\n <Switch\n label=\"Notifications\"\n isChecked={notifications}\n onChange={onNotificationsChange}\n />\n </Vertical>\n </Card.Content>\n </Card>\n );\n}\n"],"names":["appearances","SettingsPanel","appearance","notifications","onAppearanceChange","onNotificationsChange","Card","jsx","Text","jsxs","Vertical","Select","Switch"],"mappings":";;;;;AAMA,MAAMA,IAAc;AAAA,EAClB,EAAE,OAAO,UAAU,OAAO,SAAA;AAAA,EAC1B,EAAE,OAAO,SAAS,OAAO,QAAA;AAAA,EACzB,EAAE,OAAO,QAAQ,OAAO,OAAA;AAC1B;AASO,SAASC,EAAc;AAAA,EAC5B,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,uBAAAC;AACF,GAAuB;AACrB,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACD,EAAK,QAAL,EACC,UAAA,gBAAAC,EAACC,GAAA,EAAK,YAAW,QAAO,OAAM,cAAa,UAAA,WAAA,CAE3C,EAAA,CACF;AAAA,sBACCF,EAAK,SAAL,EACC,UAAA,gBAAAG,EAACC,GAAA,EAAS,KAAK,IACb,UAAA;AAAA,MAAA,gBAAAH;AAAA,QAACI;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,SAASX;AAAA,UACT,OAAOE;AAAA,UACP,UAAUE;AAAA,QAAA;AAAA,MAAA;AAAA,MAEZ,gBAAAG;AAAA,QAACK;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,WAAWT;AAAA,UACX,UAAUE;AAAA,QAAA;AAAA,MAAA;AAAA,IACZ,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
package/dist/sign-in.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react"),g=require("app-studio"),S=require("./chunks/Alert-BHlgJZAo.cjs"),b=require("./chunks/Button.pilot-eWGY9Jm5.cjs"),n=require("./chunks/Card-CK_D7gzP.cjs"),m=require("./chunks/TextField-CwaxvcqN.cjs");function h({onSubmit:p}){const[l,f]=r.useState(""),[s,o]=r.useState(""),[i,d]=r.useState(!1),[u,a]=r.useState("");async function c(){if(i)return;const e=l.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)||!s){a("Enter a valid email address and password.");return}d(!0),a("");try{await p({email:e,password:s}),o("")}catch{a("Sign-in failed. Please try again.")}finally{d(!1)}}return t.jsxs(n.Card,{children:[t.jsx(n.Card.Header,{children:t.jsx(g.Text,{fontWeight:"bold",color:"theme-text",children:"Sign in"})}),t.jsx(n.Card.Content,{children:t.jsxs(g.Form,{display:"flex",flexDirection:"column",gap:12,noValidate:!0,onSubmit:e=>{e.preventDefault(),c()},children:[t.jsx(m.TextField,{label:"Email",type:"email",value:l,onChange:f,isRequired:!0,isDisabled:i}),t.jsx(m.TextField,{label:"Password",type:"password",value:s,onChange:o,isRequired:!0,isDisabled:i}),u&&t.jsx(S.Alert,{variant:"error",title:u}),t.jsx(b.Button,{isLoading:i,"aria-busy":i||void 0,type:"submit",onClick:e=>{var x;(x=e==null?void 0:e.preventDefault)==null||x.call(e),c()},children:"Sign in"})]})})]})}exports.SignIn=h;
|
|
2
2
|
//# sourceMappingURL=sign-in.cjs.js.map
|
package/dist/sign-in.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign-in.cjs.js","sources":["../src/components/pilot/blocks/SignIn.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Form, Text } from 'app-studio';\nimport { Alert } from '../alert';\nimport { Button } from '../button';\nimport { Card } from '../card';\nimport { TextField } from '../text-field';\n\nexport interface SignInProps {\n onSubmit: (credentials: {\n email: string;\n password: string;\n }) => void | Promise<void>;\n}\n\nexport function SignIn({ onSubmit }: SignInProps) {\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [pending, setPending] = useState(false);\n const [error, setError] = useState('');\n\n async function submit() {\n if (pending) return;\n const address = email.trim();\n if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(address) || !password) {\n setError('Enter a valid email address and password.');\n return;\n }\n setPending(true);\n setError('');\n try {\n await onSubmit({ email: address, password });\n setPassword('');\n } catch {\n setError('Sign-in failed. Please try again.');\n } finally {\n setPending(false);\n }\n }\n\n return (\n <Card>\n <Card.Header>\n <Text fontWeight=\"bold\"
|
|
1
|
+
{"version":3,"file":"sign-in.cjs.js","sources":["../src/components/pilot/blocks/SignIn.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Form, Text } from 'app-studio';\nimport { Alert } from '../alert';\nimport { Button } from '../button';\nimport { Card } from '../card';\nimport { TextField } from '../text-field';\n\nexport interface SignInProps {\n onSubmit: (credentials: {\n email: string;\n password: string;\n }) => void | Promise<void>;\n}\n\nexport function SignIn({ onSubmit }: SignInProps) {\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [pending, setPending] = useState(false);\n const [error, setError] = useState('');\n\n async function submit() {\n if (pending) return;\n const address = email.trim();\n if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(address) || !password) {\n setError('Enter a valid email address and password.');\n return;\n }\n setPending(true);\n setError('');\n try {\n await onSubmit({ email: address, password });\n setPassword('');\n } catch {\n setError('Sign-in failed. Please try again.');\n } finally {\n setPending(false);\n }\n }\n\n return (\n <Card>\n <Card.Header>\n <Text fontWeight=\"bold\" color=\"theme-text\">\n Sign in\n </Text>\n </Card.Header>\n <Card.Content>\n <Form\n display=\"flex\"\n flexDirection=\"column\"\n gap={12}\n noValidate\n onSubmit={(event: React.FormEvent) => {\n event.preventDefault();\n void submit();\n }}\n >\n <TextField\n label=\"Email\"\n type=\"email\"\n value={email}\n onChange={setEmail}\n isRequired\n isDisabled={pending}\n />\n <TextField\n label=\"Password\"\n type=\"password\"\n value={password}\n onChange={setPassword}\n isRequired\n isDisabled={pending}\n />\n {error && <Alert variant=\"error\" title={error} />}\n <Button\n isLoading={pending}\n aria-busy={pending || undefined}\n type=\"submit\"\n onClick={(event?: { preventDefault?: () => void }) => {\n event?.preventDefault?.();\n void submit();\n }}\n >\n Sign in\n </Button>\n </Form>\n </Card.Content>\n </Card>\n );\n}\n"],"names":["SignIn","onSubmit","email","setEmail","useState","password","setPassword","pending","setPending","error","setError","submit","address","Card","jsx","Text","jsxs","Form","event","TextField","Alert","Button","_a"],"mappings":"8UAcO,SAASA,EAAO,CAAE,SAAAC,GAAyB,CAChD,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAAA,SAAS,EAAE,EAC/B,CAACC,EAAUC,CAAW,EAAIF,EAAAA,SAAS,EAAE,EACrC,CAACG,EAASC,CAAU,EAAIJ,EAAAA,SAAS,EAAK,EACtC,CAACK,EAAOC,CAAQ,EAAIN,EAAAA,SAAS,EAAE,EAErC,eAAeO,GAAS,CACtB,GAAIJ,EAAS,OACb,MAAMK,EAAUV,EAAM,KAAA,EACtB,GAAI,CAAC,6BAA6B,KAAKU,CAAO,GAAK,CAACP,EAAU,CAC5DK,EAAS,2CAA2C,EACpD,MACF,CACAF,EAAW,EAAI,EACfE,EAAS,EAAE,EACX,GAAI,CACF,MAAMT,EAAS,CAAE,MAAOW,EAAS,SAAAP,EAAU,EAC3CC,EAAY,EAAE,CAChB,MAAQ,CACNI,EAAS,mCAAmC,CAC9C,QAAA,CACEF,EAAW,EAAK,CAClB,CACF,CAEA,cACGK,OAAA,CACC,SAAA,CAAAC,EAAAA,IAACD,EAAAA,KAAK,OAAL,CACC,SAAAC,EAAAA,IAACC,EAAAA,KAAA,CAAK,WAAW,OAAO,MAAM,aAAa,SAAA,SAAA,CAE3C,CAAA,CACF,EACAD,EAAAA,IAACD,EAAAA,KAAK,QAAL,CACC,SAAAG,EAAAA,KAACC,EAAAA,KAAA,CACC,QAAQ,OACR,cAAc,SACd,IAAK,GACL,WAAU,GACV,SAAWC,GAA2B,CACpCA,EAAM,eAAA,EACDP,EAAA,CACP,EAEA,SAAA,CAAAG,EAAAA,IAACK,EAAAA,UAAA,CACC,MAAM,QACN,KAAK,QACL,MAAOjB,EACP,SAAUC,EACV,WAAU,GACV,WAAYI,CAAA,CAAA,EAEdO,EAAAA,IAACK,EAAAA,UAAA,CACC,MAAM,WACN,KAAK,WACL,MAAOd,EACP,SAAUC,EACV,WAAU,GACV,WAAYC,CAAA,CAAA,EAEbE,GAASK,EAAAA,IAACM,QAAA,CAAM,QAAQ,QAAQ,MAAOX,EAAO,EAC/CK,EAAAA,IAACO,EAAAA,OAAA,CACC,UAAWd,EACX,YAAWA,GAAW,OACtB,KAAK,SACL,QAAUW,GAA4C,QACpDI,EAAAJ,GAAA,YAAAA,EAAO,iBAAP,MAAAI,EAAA,KAAAJ,GACKP,EAAA,CACP,EACD,SAAA,SAAA,CAAA,CAED,CAAA,CAAA,CACF,CACF,CAAA,EACF,CAEJ"}
|