@bacon-pos/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +236 -0
- package/lib/commonjs/components/Avatar/Avatar.js +96 -0
- package/lib/commonjs/components/Avatar/Avatar.js.map +1 -0
- package/lib/commonjs/components/Avatar/Avatar.stories.js +87 -0
- package/lib/commonjs/components/Avatar/Avatar.stories.js.map +1 -0
- package/lib/commonjs/components/Avatar/Avatar.test.js +63 -0
- package/lib/commonjs/components/Avatar/Avatar.test.js.map +1 -0
- package/lib/commonjs/components/Avatar/index.js +13 -0
- package/lib/commonjs/components/Avatar/index.js.map +1 -0
- package/lib/commonjs/components/Button/Button.js +201 -0
- package/lib/commonjs/components/Button/Button.js.map +1 -0
- package/lib/commonjs/components/Button/Button.stories.js +139 -0
- package/lib/commonjs/components/Button/Button.stories.js.map +1 -0
- package/lib/commonjs/components/Button/Button.test.js +64 -0
- package/lib/commonjs/components/Button/Button.test.js.map +1 -0
- package/lib/commonjs/components/Button/index.js +13 -0
- package/lib/commonjs/components/Button/index.js.map +1 -0
- package/lib/commonjs/components/Card/Card.js +129 -0
- package/lib/commonjs/components/Card/Card.js.map +1 -0
- package/lib/commonjs/components/Card/Card.stories.js +87 -0
- package/lib/commonjs/components/Card/Card.stories.js.map +1 -0
- package/lib/commonjs/components/Card/Card.test.js +51 -0
- package/lib/commonjs/components/Card/Card.test.js.map +1 -0
- package/lib/commonjs/components/Card/index.js +13 -0
- package/lib/commonjs/components/Card/index.js.map +1 -0
- package/lib/commonjs/components/Checkbox/Checkbox.js +75 -0
- package/lib/commonjs/components/Checkbox/Checkbox.js.map +1 -0
- package/lib/commonjs/components/Checkbox/Checkbox.stories.js +69 -0
- package/lib/commonjs/components/Checkbox/Checkbox.stories.js.map +1 -0
- package/lib/commonjs/components/Checkbox/Checkbox.test.js +62 -0
- package/lib/commonjs/components/Checkbox/Checkbox.test.js.map +1 -0
- package/lib/commonjs/components/Checkbox/index.js +13 -0
- package/lib/commonjs/components/Checkbox/index.js.map +1 -0
- package/lib/commonjs/components/Chip/Chip.js +119 -0
- package/lib/commonjs/components/Chip/Chip.js.map +1 -0
- package/lib/commonjs/components/Chip/Chip.stories.js +112 -0
- package/lib/commonjs/components/Chip/Chip.stories.js.map +1 -0
- package/lib/commonjs/components/Chip/Chip.test.js +63 -0
- package/lib/commonjs/components/Chip/Chip.test.js.map +1 -0
- package/lib/commonjs/components/Chip/ChipGroup.js +54 -0
- package/lib/commonjs/components/Chip/ChipGroup.js.map +1 -0
- package/lib/commonjs/components/Chip/ChipGroup.stories.js +78 -0
- package/lib/commonjs/components/Chip/ChipGroup.stories.js.map +1 -0
- package/lib/commonjs/components/Chip/ChipGroup.test.js +70 -0
- package/lib/commonjs/components/Chip/ChipGroup.test.js.map +1 -0
- package/lib/commonjs/components/Chip/index.js +20 -0
- package/lib/commonjs/components/Chip/index.js.map +1 -0
- package/lib/commonjs/components/CodeInput/CodeInput.js +163 -0
- package/lib/commonjs/components/CodeInput/CodeInput.js.map +1 -0
- package/lib/commonjs/components/CodeInput/CodeInput.stories.js +98 -0
- package/lib/commonjs/components/CodeInput/CodeInput.stories.js.map +1 -0
- package/lib/commonjs/components/CodeInput/CodeInput.test.js +74 -0
- package/lib/commonjs/components/CodeInput/CodeInput.test.js.map +1 -0
- package/lib/commonjs/components/CodeInput/index.js +13 -0
- package/lib/commonjs/components/CodeInput/index.js.map +1 -0
- package/lib/commonjs/components/Icon/Icon.js +32 -0
- package/lib/commonjs/components/Icon/Icon.js.map +1 -0
- package/lib/commonjs/components/Icon/Icon.stories.js +94 -0
- package/lib/commonjs/components/Icon/Icon.stories.js.map +1 -0
- package/lib/commonjs/components/Icon/Icon.test.js +38 -0
- package/lib/commonjs/components/Icon/Icon.test.js.map +1 -0
- package/lib/commonjs/components/Icon/icons.generated.js +179 -0
- package/lib/commonjs/components/Icon/icons.generated.js.map +1 -0
- package/lib/commonjs/components/Icon/index.js +20 -0
- package/lib/commonjs/components/Icon/index.js.map +1 -0
- package/lib/commonjs/components/IconButton/IconButton.js +139 -0
- package/lib/commonjs/components/IconButton/IconButton.js.map +1 -0
- package/lib/commonjs/components/IconButton/IconButton.stories.js +119 -0
- package/lib/commonjs/components/IconButton/IconButton.stories.js.map +1 -0
- package/lib/commonjs/components/IconButton/IconButton.test.js +55 -0
- package/lib/commonjs/components/IconButton/IconButton.test.js.map +1 -0
- package/lib/commonjs/components/IconButton/index.js +13 -0
- package/lib/commonjs/components/IconButton/index.js.map +1 -0
- package/lib/commonjs/components/Input/Input.js +176 -0
- package/lib/commonjs/components/Input/Input.js.map +1 -0
- package/lib/commonjs/components/Input/Input.stories.js +116 -0
- package/lib/commonjs/components/Input/Input.stories.js.map +1 -0
- package/lib/commonjs/components/Input/Input.test.js +103 -0
- package/lib/commonjs/components/Input/Input.test.js.map +1 -0
- package/lib/commonjs/components/Input/index.js +13 -0
- package/lib/commonjs/components/Input/index.js.map +1 -0
- package/lib/commonjs/components/LinkButton/LinkButton.js +95 -0
- package/lib/commonjs/components/LinkButton/LinkButton.js.map +1 -0
- package/lib/commonjs/components/LinkButton/LinkButton.stories.js +91 -0
- package/lib/commonjs/components/LinkButton/LinkButton.stories.js.map +1 -0
- package/lib/commonjs/components/LinkButton/LinkButton.test.js +61 -0
- package/lib/commonjs/components/LinkButton/LinkButton.test.js.map +1 -0
- package/lib/commonjs/components/LinkButton/index.js +13 -0
- package/lib/commonjs/components/LinkButton/index.js.map +1 -0
- package/lib/commonjs/components/ProductCard/ProductCard.js +167 -0
- package/lib/commonjs/components/ProductCard/ProductCard.js.map +1 -0
- package/lib/commonjs/components/ProductCard/ProductCard.stories.js +118 -0
- package/lib/commonjs/components/ProductCard/ProductCard.stories.js.map +1 -0
- package/lib/commonjs/components/ProductCard/ProductCard.test.js +69 -0
- package/lib/commonjs/components/ProductCard/ProductCard.test.js.map +1 -0
- package/lib/commonjs/components/ProductCard/index.js +13 -0
- package/lib/commonjs/components/ProductCard/index.js.map +1 -0
- package/lib/commonjs/components/QuantityStepper/QuantityStepper.js +135 -0
- package/lib/commonjs/components/QuantityStepper/QuantityStepper.js.map +1 -0
- package/lib/commonjs/components/QuantityStepper/QuantityStepper.stories.js +90 -0
- package/lib/commonjs/components/QuantityStepper/QuantityStepper.stories.js.map +1 -0
- package/lib/commonjs/components/QuantityStepper/QuantityStepper.test.js +100 -0
- package/lib/commonjs/components/QuantityStepper/QuantityStepper.test.js.map +1 -0
- package/lib/commonjs/components/QuantityStepper/index.js +13 -0
- package/lib/commonjs/components/QuantityStepper/index.js.map +1 -0
- package/lib/commonjs/components/Radio/Radio.js +59 -0
- package/lib/commonjs/components/Radio/Radio.js.map +1 -0
- package/lib/commonjs/components/Radio/Radio.stories.js +60 -0
- package/lib/commonjs/components/Radio/Radio.stories.js.map +1 -0
- package/lib/commonjs/components/Radio/Radio.test.js +46 -0
- package/lib/commonjs/components/Radio/Radio.test.js.map +1 -0
- package/lib/commonjs/components/Radio/index.js +13 -0
- package/lib/commonjs/components/Radio/index.js.map +1 -0
- package/lib/commonjs/components/Surface/Surface.js +84 -0
- package/lib/commonjs/components/Surface/Surface.js.map +1 -0
- package/lib/commonjs/components/Surface/Surface.stories.js +97 -0
- package/lib/commonjs/components/Surface/Surface.stories.js.map +1 -0
- package/lib/commonjs/components/Surface/Surface.test.js +58 -0
- package/lib/commonjs/components/Surface/Surface.test.js.map +1 -0
- package/lib/commonjs/components/Surface/index.js +13 -0
- package/lib/commonjs/components/Surface/index.js.map +1 -0
- package/lib/commonjs/components/Switch/Switch.js +109 -0
- package/lib/commonjs/components/Switch/Switch.js.map +1 -0
- package/lib/commonjs/components/Switch/Switch.stories.js +89 -0
- package/lib/commonjs/components/Switch/Switch.stories.js.map +1 -0
- package/lib/commonjs/components/Switch/Switch.test.js +46 -0
- package/lib/commonjs/components/Switch/Switch.test.js.map +1 -0
- package/lib/commonjs/components/Switch/index.js +13 -0
- package/lib/commonjs/components/Switch/index.js.map +1 -0
- package/lib/commonjs/components/Text/Text.js +39 -0
- package/lib/commonjs/components/Text/Text.js.map +1 -0
- package/lib/commonjs/components/Text/Text.stories.js +47 -0
- package/lib/commonjs/components/Text/Text.stories.js.map +1 -0
- package/lib/commonjs/components/Text/index.js +13 -0
- package/lib/commonjs/components/Text/index.js.map +1 -0
- package/lib/commonjs/components/_internal/Labeled.js +50 -0
- package/lib/commonjs/components/_internal/Labeled.js.map +1 -0
- package/lib/commonjs/components/brand/Flag.js +45 -0
- package/lib/commonjs/components/brand/Flag.js.map +1 -0
- package/lib/commonjs/components/brand/Flag.stories.js +59 -0
- package/lib/commonjs/components/brand/Flag.stories.js.map +1 -0
- package/lib/commonjs/components/brand/Logo.js +30 -0
- package/lib/commonjs/components/brand/Logo.js.map +1 -0
- package/lib/commonjs/components/brand/Logo.stories.js +59 -0
- package/lib/commonjs/components/brand/Logo.stories.js.map +1 -0
- package/lib/commonjs/components/brand/brand.test.js +39 -0
- package/lib/commonjs/components/brand/brand.test.js.map +1 -0
- package/lib/commonjs/components/brand/generated/FlagBr.js +95 -0
- package/lib/commonjs/components/brand/generated/FlagBr.js.map +1 -0
- package/lib/commonjs/components/brand/generated/FlagUs.js +82 -0
- package/lib/commonjs/components/brand/generated/FlagUs.js.map +1 -0
- package/lib/commonjs/components/brand/generated/Mastercard.js +42 -0
- package/lib/commonjs/components/brand/generated/Mastercard.js.map +1 -0
- package/lib/commonjs/components/brand/generated/Visa.js +99 -0
- package/lib/commonjs/components/brand/generated/Visa.js.map +1 -0
- package/lib/commonjs/components/brand/index.js +27 -0
- package/lib/commonjs/components/brand/index.js.map +1 -0
- package/lib/commonjs/components/brand/registry.js +36 -0
- package/lib/commonjs/components/brand/registry.js.map +1 -0
- package/lib/commonjs/components/index.js +193 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/theme/ThemeProvider.js +52 -0
- package/lib/commonjs/theme/ThemeProvider.js.map +1 -0
- package/lib/commonjs/theme/ThemeProvider.test.js +65 -0
- package/lib/commonjs/theme/ThemeProvider.test.js.map +1 -0
- package/lib/commonjs/theme/index.js +101 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/palette.js +94 -0
- package/lib/commonjs/theme/palette.js.map +1 -0
- package/lib/commonjs/theme/spacing.js +39 -0
- package/lib/commonjs/theme/spacing.js.map +1 -0
- package/lib/commonjs/theme/themes.js +171 -0
- package/lib/commonjs/theme/themes.js.map +1 -0
- package/lib/commonjs/theme/typography.js +65 -0
- package/lib/commonjs/theme/typography.js.map +1 -0
- package/lib/module/components/Avatar/Avatar.js +92 -0
- package/lib/module/components/Avatar/Avatar.js.map +1 -0
- package/lib/module/components/Avatar/Avatar.stories.js +83 -0
- package/lib/module/components/Avatar/Avatar.stories.js.map +1 -0
- package/lib/module/components/Avatar/Avatar.test.js +62 -0
- package/lib/module/components/Avatar/Avatar.test.js.map +1 -0
- package/lib/module/components/Avatar/index.js +4 -0
- package/lib/module/components/Avatar/index.js.map +1 -0
- package/lib/module/components/Button/Button.js +197 -0
- package/lib/module/components/Button/Button.js.map +1 -0
- package/lib/module/components/Button/Button.stories.js +135 -0
- package/lib/module/components/Button/Button.stories.js.map +1 -0
- package/lib/module/components/Button/Button.test.js +63 -0
- package/lib/module/components/Button/Button.test.js.map +1 -0
- package/lib/module/components/Button/index.js +4 -0
- package/lib/module/components/Button/index.js.map +1 -0
- package/lib/module/components/Card/Card.js +125 -0
- package/lib/module/components/Card/Card.js.map +1 -0
- package/lib/module/components/Card/Card.stories.js +83 -0
- package/lib/module/components/Card/Card.stories.js.map +1 -0
- package/lib/module/components/Card/Card.test.js +50 -0
- package/lib/module/components/Card/Card.test.js.map +1 -0
- package/lib/module/components/Card/index.js +4 -0
- package/lib/module/components/Card/index.js.map +1 -0
- package/lib/module/components/Checkbox/Checkbox.js +71 -0
- package/lib/module/components/Checkbox/Checkbox.js.map +1 -0
- package/lib/module/components/Checkbox/Checkbox.stories.js +65 -0
- package/lib/module/components/Checkbox/Checkbox.stories.js.map +1 -0
- package/lib/module/components/Checkbox/Checkbox.test.js +61 -0
- package/lib/module/components/Checkbox/Checkbox.test.js.map +1 -0
- package/lib/module/components/Checkbox/index.js +4 -0
- package/lib/module/components/Checkbox/index.js.map +1 -0
- package/lib/module/components/Chip/Chip.js +115 -0
- package/lib/module/components/Chip/Chip.js.map +1 -0
- package/lib/module/components/Chip/Chip.stories.js +108 -0
- package/lib/module/components/Chip/Chip.stories.js.map +1 -0
- package/lib/module/components/Chip/Chip.test.js +62 -0
- package/lib/module/components/Chip/Chip.test.js.map +1 -0
- package/lib/module/components/Chip/ChipGroup.js +50 -0
- package/lib/module/components/Chip/ChipGroup.js.map +1 -0
- package/lib/module/components/Chip/ChipGroup.stories.js +74 -0
- package/lib/module/components/Chip/ChipGroup.stories.js.map +1 -0
- package/lib/module/components/Chip/ChipGroup.test.js +69 -0
- package/lib/module/components/Chip/ChipGroup.test.js.map +1 -0
- package/lib/module/components/Chip/index.js +5 -0
- package/lib/module/components/Chip/index.js.map +1 -0
- package/lib/module/components/CodeInput/CodeInput.js +161 -0
- package/lib/module/components/CodeInput/CodeInput.js.map +1 -0
- package/lib/module/components/CodeInput/CodeInput.stories.js +94 -0
- package/lib/module/components/CodeInput/CodeInput.stories.js.map +1 -0
- package/lib/module/components/CodeInput/CodeInput.test.js +73 -0
- package/lib/module/components/CodeInput/CodeInput.test.js.map +1 -0
- package/lib/module/components/CodeInput/index.js +4 -0
- package/lib/module/components/CodeInput/index.js.map +1 -0
- package/lib/module/components/Icon/Icon.js +28 -0
- package/lib/module/components/Icon/Icon.js.map +1 -0
- package/lib/module/components/Icon/Icon.stories.js +90 -0
- package/lib/module/components/Icon/Icon.stories.js.map +1 -0
- package/lib/module/components/Icon/Icon.test.js +37 -0
- package/lib/module/components/Icon/Icon.test.js.map +1 -0
- package/lib/module/components/Icon/icons.generated.js +175 -0
- package/lib/module/components/Icon/icons.generated.js.map +1 -0
- package/lib/module/components/Icon/index.js +5 -0
- package/lib/module/components/Icon/index.js.map +1 -0
- package/lib/module/components/IconButton/IconButton.js +135 -0
- package/lib/module/components/IconButton/IconButton.js.map +1 -0
- package/lib/module/components/IconButton/IconButton.stories.js +115 -0
- package/lib/module/components/IconButton/IconButton.stories.js.map +1 -0
- package/lib/module/components/IconButton/IconButton.test.js +54 -0
- package/lib/module/components/IconButton/IconButton.test.js.map +1 -0
- package/lib/module/components/IconButton/index.js +4 -0
- package/lib/module/components/IconButton/index.js.map +1 -0
- package/lib/module/components/Input/Input.js +174 -0
- package/lib/module/components/Input/Input.js.map +1 -0
- package/lib/module/components/Input/Input.stories.js +112 -0
- package/lib/module/components/Input/Input.stories.js.map +1 -0
- package/lib/module/components/Input/Input.test.js +103 -0
- package/lib/module/components/Input/Input.test.js.map +1 -0
- package/lib/module/components/Input/index.js +4 -0
- package/lib/module/components/Input/index.js.map +1 -0
- package/lib/module/components/LinkButton/LinkButton.js +91 -0
- package/lib/module/components/LinkButton/LinkButton.js.map +1 -0
- package/lib/module/components/LinkButton/LinkButton.stories.js +87 -0
- package/lib/module/components/LinkButton/LinkButton.stories.js.map +1 -0
- package/lib/module/components/LinkButton/LinkButton.test.js +60 -0
- package/lib/module/components/LinkButton/LinkButton.test.js.map +1 -0
- package/lib/module/components/LinkButton/index.js +4 -0
- package/lib/module/components/LinkButton/index.js.map +1 -0
- package/lib/module/components/ProductCard/ProductCard.js +163 -0
- package/lib/module/components/ProductCard/ProductCard.js.map +1 -0
- package/lib/module/components/ProductCard/ProductCard.stories.js +114 -0
- package/lib/module/components/ProductCard/ProductCard.stories.js.map +1 -0
- package/lib/module/components/ProductCard/ProductCard.test.js +68 -0
- package/lib/module/components/ProductCard/ProductCard.test.js.map +1 -0
- package/lib/module/components/ProductCard/index.js +4 -0
- package/lib/module/components/ProductCard/index.js.map +1 -0
- package/lib/module/components/QuantityStepper/QuantityStepper.js +131 -0
- package/lib/module/components/QuantityStepper/QuantityStepper.js.map +1 -0
- package/lib/module/components/QuantityStepper/QuantityStepper.stories.js +86 -0
- package/lib/module/components/QuantityStepper/QuantityStepper.stories.js.map +1 -0
- package/lib/module/components/QuantityStepper/QuantityStepper.test.js +99 -0
- package/lib/module/components/QuantityStepper/QuantityStepper.test.js.map +1 -0
- package/lib/module/components/QuantityStepper/index.js +4 -0
- package/lib/module/components/QuantityStepper/index.js.map +1 -0
- package/lib/module/components/Radio/Radio.js +55 -0
- package/lib/module/components/Radio/Radio.js.map +1 -0
- package/lib/module/components/Radio/Radio.stories.js +56 -0
- package/lib/module/components/Radio/Radio.stories.js.map +1 -0
- package/lib/module/components/Radio/Radio.test.js +45 -0
- package/lib/module/components/Radio/Radio.test.js.map +1 -0
- package/lib/module/components/Radio/index.js +4 -0
- package/lib/module/components/Radio/index.js.map +1 -0
- package/lib/module/components/Surface/Surface.js +80 -0
- package/lib/module/components/Surface/Surface.js.map +1 -0
- package/lib/module/components/Surface/Surface.stories.js +93 -0
- package/lib/module/components/Surface/Surface.stories.js.map +1 -0
- package/lib/module/components/Surface/Surface.test.js +57 -0
- package/lib/module/components/Surface/Surface.test.js.map +1 -0
- package/lib/module/components/Surface/index.js +4 -0
- package/lib/module/components/Surface/index.js.map +1 -0
- package/lib/module/components/Switch/Switch.js +105 -0
- package/lib/module/components/Switch/Switch.js.map +1 -0
- package/lib/module/components/Switch/Switch.stories.js +85 -0
- package/lib/module/components/Switch/Switch.stories.js.map +1 -0
- package/lib/module/components/Switch/Switch.test.js +45 -0
- package/lib/module/components/Switch/Switch.test.js.map +1 -0
- package/lib/module/components/Switch/index.js +4 -0
- package/lib/module/components/Switch/index.js.map +1 -0
- package/lib/module/components/Text/Text.js +35 -0
- package/lib/module/components/Text/Text.js.map +1 -0
- package/lib/module/components/Text/Text.stories.js +43 -0
- package/lib/module/components/Text/Text.stories.js.map +1 -0
- package/lib/module/components/Text/index.js +4 -0
- package/lib/module/components/Text/index.js.map +1 -0
- package/lib/module/components/_internal/Labeled.js +46 -0
- package/lib/module/components/_internal/Labeled.js.map +1 -0
- package/lib/module/components/brand/Flag.js +41 -0
- package/lib/module/components/brand/Flag.js.map +1 -0
- package/lib/module/components/brand/Flag.stories.js +55 -0
- package/lib/module/components/brand/Flag.stories.js.map +1 -0
- package/lib/module/components/brand/Logo.js +26 -0
- package/lib/module/components/brand/Logo.js.map +1 -0
- package/lib/module/components/brand/Logo.stories.js +55 -0
- package/lib/module/components/brand/Logo.stories.js.map +1 -0
- package/lib/module/components/brand/brand.test.js +38 -0
- package/lib/module/components/brand/brand.test.js.map +1 -0
- package/lib/module/components/brand/generated/FlagBr.js +90 -0
- package/lib/module/components/brand/generated/FlagBr.js.map +1 -0
- package/lib/module/components/brand/generated/FlagUs.js +76 -0
- package/lib/module/components/brand/generated/FlagUs.js.map +1 -0
- package/lib/module/components/brand/generated/Mastercard.js +37 -0
- package/lib/module/components/brand/generated/Mastercard.js.map +1 -0
- package/lib/module/components/brand/generated/Visa.js +94 -0
- package/lib/module/components/brand/generated/Visa.js.map +1 -0
- package/lib/module/components/brand/index.js +6 -0
- package/lib/module/components/brand/index.js.map +1 -0
- package/lib/module/components/brand/registry.js +31 -0
- package/lib/module/components/brand/registry.js.map +1 -0
- package/lib/module/components/index.js +20 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/index.js +10 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/theme/ThemeProvider.js +46 -0
- package/lib/module/theme/ThemeProvider.js.map +1 -0
- package/lib/module/theme/ThemeProvider.test.js +64 -0
- package/lib/module/theme/ThemeProvider.test.js.map +1 -0
- package/lib/module/theme/index.js +8 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/palette.js +90 -0
- package/lib/module/theme/palette.js.map +1 -0
- package/lib/module/theme/spacing.js +34 -0
- package/lib/module/theme/spacing.js.map +1 -0
- package/lib/module/theme/themes.js +166 -0
- package/lib/module/theme/themes.js.map +1 -0
- package/lib/module/theme/typography.js +61 -0
- package/lib/module/theme/typography.js.map +1 -0
- package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts +31 -0
- package/lib/typescript/commonjs/components/Avatar/Avatar.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Avatar/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Avatar/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Button/Button.d.ts +40 -0
- package/lib/typescript/commonjs/components/Button/Button.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Button/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Button/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts +32 -0
- package/lib/typescript/commonjs/components/Card/Card.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Card/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Card/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts +25 -0
- package/lib/typescript/commonjs/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Checkbox/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Checkbox/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Chip/Chip.d.ts +40 -0
- package/lib/typescript/commonjs/components/Chip/Chip.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Chip/ChipGroup.d.ts +49 -0
- package/lib/typescript/commonjs/components/Chip/ChipGroup.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Chip/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Chip/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/CodeInput/CodeInput.d.ts +41 -0
- package/lib/typescript/commonjs/components/CodeInput/CodeInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/CodeInput/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/CodeInput/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Icon/Icon.d.ts +19 -0
- package/lib/typescript/commonjs/components/Icon/Icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Icon/icons.generated.d.ts +171 -0
- package/lib/typescript/commonjs/components/Icon/icons.generated.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Icon/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/Icon/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/IconButton/IconButton.d.ts +34 -0
- package/lib/typescript/commonjs/components/IconButton/IconButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/IconButton/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/IconButton/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Input/Input.d.ts +38 -0
- package/lib/typescript/commonjs/components/Input/Input.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Input/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Input/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/LinkButton/LinkButton.d.ts +31 -0
- package/lib/typescript/commonjs/components/LinkButton/LinkButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/LinkButton/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/LinkButton/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ProductCard/ProductCard.d.ts +31 -0
- package/lib/typescript/commonjs/components/ProductCard/ProductCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/ProductCard/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/ProductCard/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/QuantityStepper/QuantityStepper.d.ts +36 -0
- package/lib/typescript/commonjs/components/QuantityStepper/QuantityStepper.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/QuantityStepper/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/QuantityStepper/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Radio/Radio.d.ts +23 -0
- package/lib/typescript/commonjs/components/Radio/Radio.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Radio/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Radio/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Surface/Surface.d.ts +31 -0
- package/lib/typescript/commonjs/components/Surface/Surface.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Surface/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Surface/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Switch/Switch.d.ts +26 -0
- package/lib/typescript/commonjs/components/Switch/Switch.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Switch/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Switch/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Text/Text.d.ts +21 -0
- package/lib/typescript/commonjs/components/Text/Text.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Text/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/Text/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/_internal/Labeled.d.ts +27 -0
- package/lib/typescript/commonjs/components/_internal/Labeled.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/Flag.d.ts +14 -0
- package/lib/typescript/commonjs/components/brand/Flag.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/Logo.d.ts +15 -0
- package/lib/typescript/commonjs/components/brand/Logo.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/generated/FlagBr.d.ts +4 -0
- package/lib/typescript/commonjs/components/brand/generated/FlagBr.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/generated/FlagUs.d.ts +4 -0
- package/lib/typescript/commonjs/components/brand/generated/FlagUs.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/generated/Mastercard.d.ts +4 -0
- package/lib/typescript/commonjs/components/brand/generated/Mastercard.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/generated/Visa.d.ts +4 -0
- package/lib/typescript/commonjs/components/brand/generated/Visa.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/index.d.ts +4 -0
- package/lib/typescript/commonjs/components/brand/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/brand/registry.d.ts +33 -0
- package/lib/typescript/commonjs/components/brand/registry.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/index.d.ts +19 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +8 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/theme/ThemeProvider.d.ts +29 -0
- package/lib/typescript/commonjs/theme/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/index.d.ts +6 -0
- package/lib/typescript/commonjs/theme/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/palette.d.ts +89 -0
- package/lib/typescript/commonjs/theme/palette.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/spacing.d.ts +34 -0
- package/lib/typescript/commonjs/theme/spacing.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/themes.d.ts +93 -0
- package/lib/typescript/commonjs/theme/themes.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/typography.d.ts +60 -0
- package/lib/typescript/commonjs/theme/typography.d.ts.map +1 -0
- package/lib/typescript/module/components/Avatar/Avatar.d.ts +31 -0
- package/lib/typescript/module/components/Avatar/Avatar.d.ts.map +1 -0
- package/lib/typescript/module/components/Avatar/index.d.ts +2 -0
- package/lib/typescript/module/components/Avatar/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Button/Button.d.ts +40 -0
- package/lib/typescript/module/components/Button/Button.d.ts.map +1 -0
- package/lib/typescript/module/components/Button/index.d.ts +2 -0
- package/lib/typescript/module/components/Button/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/Card.d.ts +32 -0
- package/lib/typescript/module/components/Card/Card.d.ts.map +1 -0
- package/lib/typescript/module/components/Card/index.d.ts +2 -0
- package/lib/typescript/module/components/Card/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Checkbox/Checkbox.d.ts +25 -0
- package/lib/typescript/module/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/lib/typescript/module/components/Checkbox/index.d.ts +2 -0
- package/lib/typescript/module/components/Checkbox/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Chip/Chip.d.ts +40 -0
- package/lib/typescript/module/components/Chip/Chip.d.ts.map +1 -0
- package/lib/typescript/module/components/Chip/ChipGroup.d.ts +49 -0
- package/lib/typescript/module/components/Chip/ChipGroup.d.ts.map +1 -0
- package/lib/typescript/module/components/Chip/index.d.ts +3 -0
- package/lib/typescript/module/components/Chip/index.d.ts.map +1 -0
- package/lib/typescript/module/components/CodeInput/CodeInput.d.ts +41 -0
- package/lib/typescript/module/components/CodeInput/CodeInput.d.ts.map +1 -0
- package/lib/typescript/module/components/CodeInput/index.d.ts +2 -0
- package/lib/typescript/module/components/CodeInput/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Icon/Icon.d.ts +19 -0
- package/lib/typescript/module/components/Icon/Icon.d.ts.map +1 -0
- package/lib/typescript/module/components/Icon/icons.generated.d.ts +171 -0
- package/lib/typescript/module/components/Icon/icons.generated.d.ts.map +1 -0
- package/lib/typescript/module/components/Icon/index.d.ts +3 -0
- package/lib/typescript/module/components/Icon/index.d.ts.map +1 -0
- package/lib/typescript/module/components/IconButton/IconButton.d.ts +34 -0
- package/lib/typescript/module/components/IconButton/IconButton.d.ts.map +1 -0
- package/lib/typescript/module/components/IconButton/index.d.ts +2 -0
- package/lib/typescript/module/components/IconButton/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Input/Input.d.ts +38 -0
- package/lib/typescript/module/components/Input/Input.d.ts.map +1 -0
- package/lib/typescript/module/components/Input/index.d.ts +2 -0
- package/lib/typescript/module/components/Input/index.d.ts.map +1 -0
- package/lib/typescript/module/components/LinkButton/LinkButton.d.ts +31 -0
- package/lib/typescript/module/components/LinkButton/LinkButton.d.ts.map +1 -0
- package/lib/typescript/module/components/LinkButton/index.d.ts +2 -0
- package/lib/typescript/module/components/LinkButton/index.d.ts.map +1 -0
- package/lib/typescript/module/components/ProductCard/ProductCard.d.ts +31 -0
- package/lib/typescript/module/components/ProductCard/ProductCard.d.ts.map +1 -0
- package/lib/typescript/module/components/ProductCard/index.d.ts +2 -0
- package/lib/typescript/module/components/ProductCard/index.d.ts.map +1 -0
- package/lib/typescript/module/components/QuantityStepper/QuantityStepper.d.ts +36 -0
- package/lib/typescript/module/components/QuantityStepper/QuantityStepper.d.ts.map +1 -0
- package/lib/typescript/module/components/QuantityStepper/index.d.ts +2 -0
- package/lib/typescript/module/components/QuantityStepper/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Radio/Radio.d.ts +23 -0
- package/lib/typescript/module/components/Radio/Radio.d.ts.map +1 -0
- package/lib/typescript/module/components/Radio/index.d.ts +2 -0
- package/lib/typescript/module/components/Radio/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Surface/Surface.d.ts +31 -0
- package/lib/typescript/module/components/Surface/Surface.d.ts.map +1 -0
- package/lib/typescript/module/components/Surface/index.d.ts +2 -0
- package/lib/typescript/module/components/Surface/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Switch/Switch.d.ts +26 -0
- package/lib/typescript/module/components/Switch/Switch.d.ts.map +1 -0
- package/lib/typescript/module/components/Switch/index.d.ts +2 -0
- package/lib/typescript/module/components/Switch/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Text/Text.d.ts +21 -0
- package/lib/typescript/module/components/Text/Text.d.ts.map +1 -0
- package/lib/typescript/module/components/Text/index.d.ts +2 -0
- package/lib/typescript/module/components/Text/index.d.ts.map +1 -0
- package/lib/typescript/module/components/_internal/Labeled.d.ts +27 -0
- package/lib/typescript/module/components/_internal/Labeled.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/Flag.d.ts +14 -0
- package/lib/typescript/module/components/brand/Flag.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/Logo.d.ts +15 -0
- package/lib/typescript/module/components/brand/Logo.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/generated/FlagBr.d.ts +4 -0
- package/lib/typescript/module/components/brand/generated/FlagBr.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/generated/FlagUs.d.ts +4 -0
- package/lib/typescript/module/components/brand/generated/FlagUs.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/generated/Mastercard.d.ts +4 -0
- package/lib/typescript/module/components/brand/generated/Mastercard.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/generated/Visa.d.ts +4 -0
- package/lib/typescript/module/components/brand/generated/Visa.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/index.d.ts +4 -0
- package/lib/typescript/module/components/brand/index.d.ts.map +1 -0
- package/lib/typescript/module/components/brand/registry.d.ts +33 -0
- package/lib/typescript/module/components/brand/registry.d.ts.map +1 -0
- package/lib/typescript/module/components/index.d.ts +19 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +8 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/theme/ThemeProvider.d.ts +29 -0
- package/lib/typescript/module/theme/ThemeProvider.d.ts.map +1 -0
- package/lib/typescript/module/theme/index.d.ts +6 -0
- package/lib/typescript/module/theme/index.d.ts.map +1 -0
- package/lib/typescript/module/theme/palette.d.ts +89 -0
- package/lib/typescript/module/theme/palette.d.ts.map +1 -0
- package/lib/typescript/module/theme/spacing.d.ts +34 -0
- package/lib/typescript/module/theme/spacing.d.ts.map +1 -0
- package/lib/typescript/module/theme/themes.d.ts +93 -0
- package/lib/typescript/module/theme/themes.d.ts.map +1 -0
- package/lib/typescript/module/theme/typography.d.ts +60 -0
- package/lib/typescript/module/theme/typography.d.ts.map +1 -0
- package/package.json +116 -0
- package/src/components/Avatar/Avatar.tsx +111 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Button/Button.tsx +216 -0
- package/src/components/Button/index.ts +6 -0
- package/src/components/Card/Card.tsx +145 -0
- package/src/components/Card/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.tsx +86 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Chip/Chip.tsx +126 -0
- package/src/components/Chip/ChipGroup.tsx +88 -0
- package/src/components/Chip/index.ts +2 -0
- package/src/components/CodeInput/CodeInput.tsx +200 -0
- package/src/components/CodeInput/index.ts +1 -0
- package/src/components/Icon/Icon.tsx +32 -0
- package/src/components/Icon/icons.generated.ts +174 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/IconButton/IconButton.tsx +156 -0
- package/src/components/IconButton/index.ts +7 -0
- package/src/components/Input/Input.tsx +230 -0
- package/src/components/Input/index.ts +1 -0
- package/src/components/LinkButton/LinkButton.tsx +118 -0
- package/src/components/LinkButton/index.ts +6 -0
- package/src/components/ProductCard/ProductCard.tsx +176 -0
- package/src/components/ProductCard/index.ts +1 -0
- package/src/components/QuantityStepper/QuantityStepper.tsx +162 -0
- package/src/components/QuantityStepper/index.ts +5 -0
- package/src/components/Radio/Radio.tsx +76 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/Surface/Surface.tsx +99 -0
- package/src/components/Surface/index.ts +6 -0
- package/src/components/Switch/Switch.tsx +110 -0
- package/src/components/Switch/index.ts +1 -0
- package/src/components/Text/Text.tsx +51 -0
- package/src/components/Text/index.ts +1 -0
- package/src/components/_internal/Labeled.tsx +72 -0
- package/src/components/brand/Flag.tsx +41 -0
- package/src/components/brand/Logo.tsx +23 -0
- package/src/components/brand/generated/FlagBr.tsx +8 -0
- package/src/components/brand/generated/FlagUs.tsx +7 -0
- package/src/components/brand/generated/Mastercard.tsx +4 -0
- package/src/components/brand/generated/Visa.tsx +4 -0
- package/src/components/brand/index.ts +3 -0
- package/src/components/brand/registry.ts +27 -0
- package/src/components/index.ts +19 -0
- package/src/index.tsx +7 -0
- package/src/theme/ThemeProvider.tsx +66 -0
- package/src/theme/index.ts +31 -0
- package/src/theme/palette.ts +89 -0
- package/src/theme/spacing.ts +37 -0
- package/src/theme/themes.ts +248 -0
- package/src/theme/typography.ts +37 -0
package/package.json
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bacon-pos/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Bacon POS design system — React Native component library",
|
|
5
|
+
"main": "./lib/commonjs/index.js",
|
|
6
|
+
"module": "./lib/module/index.js",
|
|
7
|
+
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./lib/typescript/module/index.d.ts",
|
|
12
|
+
"default": "./lib/module/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
16
|
+
"default": "./lib/commonjs/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"src",
|
|
23
|
+
"lib",
|
|
24
|
+
"!**/__tests__",
|
|
25
|
+
"!**/*.test.ts",
|
|
26
|
+
"!**/*.test.tsx",
|
|
27
|
+
"!**/*.stories.ts",
|
|
28
|
+
"!**/*.stories.tsx"
|
|
29
|
+
],
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"scripts": {
|
|
32
|
+
"clean": "del-cli lib",
|
|
33
|
+
"build": "bob build",
|
|
34
|
+
"prepare": "bob build",
|
|
35
|
+
"typecheck": "tsc --noEmit",
|
|
36
|
+
"gen:icons": "node scripts/generate-icons.mjs",
|
|
37
|
+
"gen:graphics": "node scripts/generate-graphics.mjs",
|
|
38
|
+
"test": "jest",
|
|
39
|
+
"storybook": "storybook dev -p 6006",
|
|
40
|
+
"build-storybook": "storybook build",
|
|
41
|
+
"release": "changeset publish",
|
|
42
|
+
"version": "changeset version"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"react-native",
|
|
46
|
+
"expo",
|
|
47
|
+
"design-system",
|
|
48
|
+
"component-library",
|
|
49
|
+
"ui",
|
|
50
|
+
"bacon-pos"
|
|
51
|
+
],
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"react": ">=18.0.0",
|
|
58
|
+
"react-native": ">=0.74.0",
|
|
59
|
+
"react-native-svg": ">=15.0.0"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@babel/core": "^7.25.2",
|
|
63
|
+
"@changesets/cli": "^2.27.11",
|
|
64
|
+
"@react-native/babel-preset": "0.79.5",
|
|
65
|
+
"@storybook/addon-essentials": "^8.6.14",
|
|
66
|
+
"@storybook/react": "^8.6.14",
|
|
67
|
+
"@storybook/react-native-web-vite": "^8.6.14",
|
|
68
|
+
"@svgr/cli": "^8.1.0",
|
|
69
|
+
"@svgr/core": "^8.1.0",
|
|
70
|
+
"@svgr/plugin-jsx": "^8.1.0",
|
|
71
|
+
"@testing-library/react-native": "^13.0.1",
|
|
72
|
+
"@types/jest": "^29.5.14",
|
|
73
|
+
"@types/react": "~19.0.10",
|
|
74
|
+
"del-cli": "^6.0.0",
|
|
75
|
+
"jest": "^29.7.0",
|
|
76
|
+
"react": "19.0.0",
|
|
77
|
+
"react-dom": "19.0.0",
|
|
78
|
+
"react-native": "0.79.5",
|
|
79
|
+
"react-native-builder-bob": "^0.40.5",
|
|
80
|
+
"react-native-svg": "15.11.2",
|
|
81
|
+
"react-native-web": "^0.20.0",
|
|
82
|
+
"react-test-renderer": "19.0.0",
|
|
83
|
+
"storybook": "^8.6.14",
|
|
84
|
+
"typescript": "~5.8.3",
|
|
85
|
+
"vite": "^6.0.0"
|
|
86
|
+
},
|
|
87
|
+
"jest": {
|
|
88
|
+
"preset": "react-native",
|
|
89
|
+
"modulePathIgnorePatterns": [
|
|
90
|
+
"<rootDir>/lib/"
|
|
91
|
+
],
|
|
92
|
+
"transformIgnorePatterns": [
|
|
93
|
+
"node_modules/.pnpm/(?!(?:@react-native|react-native))"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
"react-native-builder-bob": {
|
|
97
|
+
"source": "src",
|
|
98
|
+
"output": "lib",
|
|
99
|
+
"targets": [
|
|
100
|
+
[
|
|
101
|
+
"commonjs",
|
|
102
|
+
{
|
|
103
|
+
"esm": true
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
"module",
|
|
108
|
+
{
|
|
109
|
+
"esm": true
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"typescript"
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
"packageManager": "pnpm@10.12.1+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac"
|
|
116
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Image, View, type ImageSourcePropType, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../theme';
|
|
4
|
+
import type { TypographyVariant } from '../../theme/typography';
|
|
5
|
+
import { Text } from '../Text/Text';
|
|
6
|
+
|
|
7
|
+
export type AvatarSize = 'sm' | 'md' | 'lg';
|
|
8
|
+
|
|
9
|
+
export interface AvatarProps {
|
|
10
|
+
/** Image source; when omitted or it fails to load, initials are shown. */
|
|
11
|
+
source?: ImageSourcePropType;
|
|
12
|
+
/** Full name used to derive the initials. */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** Explicit initials (overrides `name`). */
|
|
15
|
+
initials?: string;
|
|
16
|
+
/** How many initials to show: 1 or 2. Defaults to 2. */
|
|
17
|
+
initialsCount?: 1 | 2;
|
|
18
|
+
/** Size preset: `sm` 32 / `md` 40 / `lg` 56. Defaults to `md`. */
|
|
19
|
+
size?: AvatarSize;
|
|
20
|
+
/** Custom diameter in px. Overrides `size` when set; initials scale to fit. */
|
|
21
|
+
diameter?: number;
|
|
22
|
+
/** Initials color. Defaults to a neutral foreground. */
|
|
23
|
+
color?: string;
|
|
24
|
+
/** Background behind initials (kept lighter than the initials). Defaults to a light neutral. */
|
|
25
|
+
backgroundColor?: string;
|
|
26
|
+
/** Override the container style. */
|
|
27
|
+
style?: StyleProp<ViewStyle>;
|
|
28
|
+
/** Accessibility label (defaults to `name`). */
|
|
29
|
+
accessibilityLabel?: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const SIZES: Record<AvatarSize, { diameter: number; text: TypographyVariant }> = {
|
|
33
|
+
sm: { diameter: 32, text: 'bodySmall' },
|
|
34
|
+
md: { diameter: 40, text: 'bodyMedium' },
|
|
35
|
+
lg: { diameter: 56, text: 'h3' },
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
function getInitials(name: string | undefined, explicit: string | undefined, count: 1 | 2): string {
|
|
39
|
+
if (explicit) return explicit.slice(0, count).toUpperCase();
|
|
40
|
+
if (!name) return '';
|
|
41
|
+
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
42
|
+
const first = words[0];
|
|
43
|
+
if (!first) return '';
|
|
44
|
+
if (count === 1) return first.charAt(0).toUpperCase();
|
|
45
|
+
const second = words[1];
|
|
46
|
+
if (second) return (first.charAt(0) + second.charAt(0)).toUpperCase();
|
|
47
|
+
return first.slice(0, 2).toUpperCase();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Avatar — circular user image with an initials fallback. Shows the photo when
|
|
52
|
+
* `source` loads; otherwise shows 1–2 uppercase initials on a lighter background.
|
|
53
|
+
* Sizes: sm / md / lg.
|
|
54
|
+
*/
|
|
55
|
+
export function Avatar({
|
|
56
|
+
source,
|
|
57
|
+
name,
|
|
58
|
+
initials,
|
|
59
|
+
initialsCount = 2,
|
|
60
|
+
size = 'md',
|
|
61
|
+
diameter,
|
|
62
|
+
color,
|
|
63
|
+
backgroundColor,
|
|
64
|
+
style,
|
|
65
|
+
accessibilityLabel,
|
|
66
|
+
}: AvatarProps) {
|
|
67
|
+
const theme = useTheme();
|
|
68
|
+
const cfg = SIZES[size];
|
|
69
|
+
const [errored, setErrored] = useState(false);
|
|
70
|
+
const showImage = source != null && !errored;
|
|
71
|
+
|
|
72
|
+
const d = diameter ?? cfg.diameter;
|
|
73
|
+
const bg = backgroundColor ?? theme.colors.background.muted;
|
|
74
|
+
const fg = color ?? theme.colors.text.secondary;
|
|
75
|
+
// With a custom diameter, scale the initials to fit; otherwise use the preset.
|
|
76
|
+
const initialsStyle = diameter
|
|
77
|
+
? { fontSize: Math.round(d * 0.4), lineHeight: Math.round(d * 0.5) }
|
|
78
|
+
: undefined;
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<View
|
|
82
|
+
accessibilityRole="image"
|
|
83
|
+
accessibilityLabel={accessibilityLabel ?? name}
|
|
84
|
+
style={[
|
|
85
|
+
{
|
|
86
|
+
width: d,
|
|
87
|
+
height: d,
|
|
88
|
+
borderRadius: d / 2,
|
|
89
|
+
overflow: 'hidden',
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
justifyContent: 'center',
|
|
92
|
+
backgroundColor: showImage ? theme.colors.background.default : bg,
|
|
93
|
+
},
|
|
94
|
+
style,
|
|
95
|
+
]}
|
|
96
|
+
>
|
|
97
|
+
{showImage ? (
|
|
98
|
+
<Image
|
|
99
|
+
source={source}
|
|
100
|
+
resizeMode="cover"
|
|
101
|
+
onError={() => setErrored(true)}
|
|
102
|
+
style={{ width: '100%', height: '100%' }}
|
|
103
|
+
/>
|
|
104
|
+
) : (
|
|
105
|
+
<Text variant={cfg.text} weight="semibold" color={fg} style={initialsStyle}>
|
|
106
|
+
{getInitials(name, initials, initialsCount)}
|
|
107
|
+
</Text>
|
|
108
|
+
)}
|
|
109
|
+
</View>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Avatar, type AvatarProps, type AvatarSize } from './Avatar';
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { useMemo, type ReactNode } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
ActivityIndicator,
|
|
4
|
+
Pressable,
|
|
5
|
+
View,
|
|
6
|
+
type PressableProps,
|
|
7
|
+
type PressableStateCallbackType,
|
|
8
|
+
type StyleProp,
|
|
9
|
+
type ViewStyle,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
import { useTheme, type Theme } from '../../theme';
|
|
12
|
+
import type { TypographyVariant } from '../../theme/typography';
|
|
13
|
+
import { Text } from '../Text/Text';
|
|
14
|
+
|
|
15
|
+
/** Visual styles — 1:1 with the Figma "Round buttons" style variants. */
|
|
16
|
+
export type ButtonVariant =
|
|
17
|
+
| 'default'
|
|
18
|
+
| 'secondary'
|
|
19
|
+
| 'inverse'
|
|
20
|
+
| 'destructive'
|
|
21
|
+
| 'success'
|
|
22
|
+
| 'successSubtle';
|
|
23
|
+
|
|
24
|
+
export type ButtonSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
25
|
+
|
|
26
|
+
/** `round` = pill (default), `square` = 16px corner radius. */
|
|
27
|
+
export type ButtonShape = 'round' | 'square';
|
|
28
|
+
|
|
29
|
+
export interface ButtonProps extends Omit<PressableProps, 'style' | 'children'> {
|
|
30
|
+
/** Visual style. Defaults to `default` (the lime accent action). */
|
|
31
|
+
variant?: ButtonVariant;
|
|
32
|
+
/** Control height and typography. Defaults to `lg`. */
|
|
33
|
+
size?: ButtonSize;
|
|
34
|
+
/** Corner style. Defaults to `round` (pill). */
|
|
35
|
+
shape?: ButtonShape;
|
|
36
|
+
/** Button label. */
|
|
37
|
+
label: string;
|
|
38
|
+
/** Show a spinner in the leading slot and block presses. The label stays visible. */
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
/** Disable interaction and apply disabled tokens. */
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/** Stretch to the full width of the parent. */
|
|
43
|
+
fullWidth?: boolean;
|
|
44
|
+
/** Element rendered before the label (sized to the size's icon box). */
|
|
45
|
+
leftIcon?: ReactNode;
|
|
46
|
+
/** Element rendered after the label. */
|
|
47
|
+
rightIcon?: ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* Element rendered above the label in a vertical stack. Only applies when
|
|
50
|
+
* `shape="square"` — ignored otherwise. Takes precedence over left/right icons.
|
|
51
|
+
*/
|
|
52
|
+
topIcon?: ReactNode;
|
|
53
|
+
/** Override the container style. */
|
|
54
|
+
style?: StyleProp<ViewStyle>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const SIZES: Record<
|
|
58
|
+
ButtonSize,
|
|
59
|
+
{ height: number; paddingHorizontal: number; gap: number; textVariant: TypographyVariant; iconSize: number }
|
|
60
|
+
> = {
|
|
61
|
+
sm: { height: 48, paddingHorizontal: 16, gap: 10, textVariant: 'bodyMedium', iconSize: 20 },
|
|
62
|
+
md: { height: 58, paddingHorizontal: 24, gap: 10, textVariant: 'bodyLarge', iconSize: 24 },
|
|
63
|
+
lg: { height: 74, paddingHorizontal: 24, gap: 10, textVariant: 'bodyLarge', iconSize: 24 },
|
|
64
|
+
xl: { height: 90, paddingHorizontal: 24, gap: 10, textVariant: 'bodyLarge', iconSize: 24 },
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
interface VariantColors {
|
|
68
|
+
backgroundColor: string;
|
|
69
|
+
textColor: string;
|
|
70
|
+
borderColor: string;
|
|
71
|
+
borderWidth: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function getVariantColors(theme: Theme, variant: ButtonVariant): VariantColors {
|
|
75
|
+
const { action, state, border } = theme.colors;
|
|
76
|
+
const base: Omit<VariantColors, 'backgroundColor' | 'textColor'> = {
|
|
77
|
+
borderColor: 'transparent',
|
|
78
|
+
borderWidth: 0,
|
|
79
|
+
};
|
|
80
|
+
switch (variant) {
|
|
81
|
+
case 'secondary':
|
|
82
|
+
return {
|
|
83
|
+
backgroundColor: action.secondary,
|
|
84
|
+
textColor: action.secondaryForeground,
|
|
85
|
+
borderColor: border.default,
|
|
86
|
+
borderWidth: 1,
|
|
87
|
+
};
|
|
88
|
+
case 'inverse':
|
|
89
|
+
return { backgroundColor: action.inverse, textColor: action.inverseForeground, ...base };
|
|
90
|
+
case 'destructive':
|
|
91
|
+
return {
|
|
92
|
+
backgroundColor: state.destructiveSubtle,
|
|
93
|
+
textColor: state.destructiveSubtleForeground,
|
|
94
|
+
...base,
|
|
95
|
+
};
|
|
96
|
+
case 'success':
|
|
97
|
+
return { backgroundColor: state.success, textColor: state.successForeground, ...base };
|
|
98
|
+
case 'successSubtle':
|
|
99
|
+
return {
|
|
100
|
+
backgroundColor: state.successSubtle,
|
|
101
|
+
textColor: state.successSubtleForeground,
|
|
102
|
+
...base,
|
|
103
|
+
};
|
|
104
|
+
case 'default':
|
|
105
|
+
default:
|
|
106
|
+
return { backgroundColor: action.primary, textColor: action.primaryForeground, ...base };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Text button — faithful to the Bacon POS Figma "Buttons" frame.
|
|
112
|
+
* Colors, sizes, radii and states are driven by theme tokens.
|
|
113
|
+
*/
|
|
114
|
+
export function Button({
|
|
115
|
+
variant = 'default',
|
|
116
|
+
size = 'lg',
|
|
117
|
+
shape = 'round',
|
|
118
|
+
label,
|
|
119
|
+
loading = false,
|
|
120
|
+
disabled = false,
|
|
121
|
+
fullWidth = false,
|
|
122
|
+
leftIcon,
|
|
123
|
+
rightIcon,
|
|
124
|
+
topIcon,
|
|
125
|
+
style,
|
|
126
|
+
...rest
|
|
127
|
+
}: ButtonProps) {
|
|
128
|
+
const theme = useTheme();
|
|
129
|
+
const sizeConfig = SIZES[size];
|
|
130
|
+
const isDisabled = disabled || loading;
|
|
131
|
+
|
|
132
|
+
const colors = useMemo<VariantColors>(() => {
|
|
133
|
+
const variantColors = getVariantColors(theme, variant);
|
|
134
|
+
if (!isDisabled) return variantColors;
|
|
135
|
+
return {
|
|
136
|
+
backgroundColor: theme.colors.disabled.background,
|
|
137
|
+
textColor: theme.colors.disabled.foreground,
|
|
138
|
+
borderColor: variantColors.borderWidth > 0 ? theme.colors.disabled.border : 'transparent',
|
|
139
|
+
borderWidth: variantColors.borderWidth,
|
|
140
|
+
};
|
|
141
|
+
}, [theme, variant, isDisabled]);
|
|
142
|
+
|
|
143
|
+
const borderRadius = shape === 'square' ? theme.radii.xl : theme.radii.pill;
|
|
144
|
+
// Vertical (icon-on-top) layout is only allowed for the square shape.
|
|
145
|
+
const isVertical = shape === 'square' && !!topIcon;
|
|
146
|
+
|
|
147
|
+
const containerStyle = useMemo(
|
|
148
|
+
() =>
|
|
149
|
+
({ pressed }: PressableStateCallbackType): StyleProp<ViewStyle> => [
|
|
150
|
+
{
|
|
151
|
+
...(isVertical
|
|
152
|
+
? { paddingVertical: 16, flexDirection: 'column' as const }
|
|
153
|
+
: { height: sizeConfig.height, flexDirection: 'row' as const }),
|
|
154
|
+
paddingHorizontal: sizeConfig.paddingHorizontal,
|
|
155
|
+
borderRadius,
|
|
156
|
+
borderWidth: colors.borderWidth,
|
|
157
|
+
borderColor: colors.borderColor,
|
|
158
|
+
backgroundColor: colors.backgroundColor,
|
|
159
|
+
alignItems: 'center',
|
|
160
|
+
justifyContent: 'center',
|
|
161
|
+
gap: isVertical ? 16 : sizeConfig.gap,
|
|
162
|
+
opacity: pressed && !isDisabled ? 0.9 : 1,
|
|
163
|
+
alignSelf: fullWidth ? 'stretch' : 'flex-start',
|
|
164
|
+
} satisfies ViewStyle,
|
|
165
|
+
style,
|
|
166
|
+
],
|
|
167
|
+
[isVertical, sizeConfig, borderRadius, colors, isDisabled, fullWidth, style],
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
const iconBox: ViewStyle = {
|
|
171
|
+
width: sizeConfig.iconSize,
|
|
172
|
+
height: sizeConfig.iconSize,
|
|
173
|
+
alignItems: 'center',
|
|
174
|
+
justifyContent: 'center',
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
return (
|
|
178
|
+
<Pressable
|
|
179
|
+
accessibilityRole="button"
|
|
180
|
+
accessibilityState={{ disabled: isDisabled, busy: loading }}
|
|
181
|
+
disabled={isDisabled}
|
|
182
|
+
style={containerStyle}
|
|
183
|
+
{...rest}
|
|
184
|
+
>
|
|
185
|
+
{isVertical ? (
|
|
186
|
+
<>
|
|
187
|
+
{loading ? (
|
|
188
|
+
<ActivityIndicator color={colors.textColor} size="small" />
|
|
189
|
+
) : (
|
|
190
|
+
<View style={iconBox}>{topIcon}</View>
|
|
191
|
+
)}
|
|
192
|
+
<Text
|
|
193
|
+
variant={sizeConfig.textVariant}
|
|
194
|
+
weight="medium"
|
|
195
|
+
color={colors.textColor}
|
|
196
|
+
align="center"
|
|
197
|
+
>
|
|
198
|
+
{label}
|
|
199
|
+
</Text>
|
|
200
|
+
</>
|
|
201
|
+
) : (
|
|
202
|
+
<>
|
|
203
|
+
{loading ? (
|
|
204
|
+
<ActivityIndicator color={colors.textColor} size="small" />
|
|
205
|
+
) : leftIcon ? (
|
|
206
|
+
<View style={iconBox}>{leftIcon}</View>
|
|
207
|
+
) : null}
|
|
208
|
+
<Text variant={sizeConfig.textVariant} weight="medium" color={colors.textColor}>
|
|
209
|
+
{label}
|
|
210
|
+
</Text>
|
|
211
|
+
{!loading && rightIcon ? <View style={iconBox}>{rightIcon}</View> : null}
|
|
212
|
+
</>
|
|
213
|
+
)}
|
|
214
|
+
</Pressable>
|
|
215
|
+
);
|
|
216
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { useMemo, type ReactNode } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
View,
|
|
5
|
+
type PressableStateCallbackType,
|
|
6
|
+
type StyleProp,
|
|
7
|
+
type ViewStyle,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import { useTheme, type Theme } from '../../theme';
|
|
10
|
+
import { Icon } from '../Icon/Icon';
|
|
11
|
+
import type { IconName } from '../Icon/icons.generated';
|
|
12
|
+
import { Text } from '../Text/Text';
|
|
13
|
+
|
|
14
|
+
export interface CardProps {
|
|
15
|
+
/** Bold card title (H3). */
|
|
16
|
+
title?: string;
|
|
17
|
+
/** Supporting description below the title. */
|
|
18
|
+
description?: string;
|
|
19
|
+
/** Optional leading icon shown above the title. */
|
|
20
|
+
icon?: IconName;
|
|
21
|
+
/** Selected state — lime surface, lime border + focus ring, checked radio. */
|
|
22
|
+
selected?: boolean;
|
|
23
|
+
/** Show the radio indicator in the top-right corner. Defaults to true. */
|
|
24
|
+
showRadio?: boolean;
|
|
25
|
+
/** Makes the card pressable (to select it). */
|
|
26
|
+
onPress?: () => void;
|
|
27
|
+
/** Dim and block presses. */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** Extra content rendered after the description. */
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
/** Override the container style. */
|
|
32
|
+
style?: StyleProp<ViewStyle>;
|
|
33
|
+
/** Accessibility label (defaults to `title`). */
|
|
34
|
+
accessibilityLabel?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function Radio({ selected, theme }: { selected: boolean; theme: Theme }) {
|
|
38
|
+
return (
|
|
39
|
+
<View
|
|
40
|
+
style={{
|
|
41
|
+
width: 20,
|
|
42
|
+
height: 20,
|
|
43
|
+
borderRadius: 10,
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
justifyContent: 'center',
|
|
46
|
+
...(selected
|
|
47
|
+
? { backgroundColor: theme.colors.action.primary }
|
|
48
|
+
: { borderWidth: 1.5, borderColor: theme.colors.border.strong }),
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{selected ? <Icon name="check" size={14} color={theme.colors.action.primaryForeground} /> : null}
|
|
52
|
+
</View>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Selectable card — faithful to the Bacon POS Figma "Card". A padded rounded
|
|
58
|
+
* surface with an optional icon, title, description and a radio indicator;
|
|
59
|
+
* `selected` applies the lime surface, border and focus ring.
|
|
60
|
+
*/
|
|
61
|
+
export function Card({
|
|
62
|
+
title,
|
|
63
|
+
description,
|
|
64
|
+
icon,
|
|
65
|
+
selected = false,
|
|
66
|
+
showRadio = true,
|
|
67
|
+
onPress,
|
|
68
|
+
disabled = false,
|
|
69
|
+
children,
|
|
70
|
+
style,
|
|
71
|
+
accessibilityLabel,
|
|
72
|
+
}: CardProps) {
|
|
73
|
+
const theme = useTheme();
|
|
74
|
+
|
|
75
|
+
const baseStyle = useMemo<ViewStyle>(() => {
|
|
76
|
+
return {
|
|
77
|
+
gap: theme.spacing.md,
|
|
78
|
+
padding: theme.spacing['2xl'],
|
|
79
|
+
borderRadius: theme.radii['3xl'],
|
|
80
|
+
overflow: 'hidden',
|
|
81
|
+
borderWidth: 1,
|
|
82
|
+
borderColor: selected ? theme.colors.border.focus : 'transparent',
|
|
83
|
+
backgroundColor: selected
|
|
84
|
+
? theme.colors.brand.accentSubtle // surface/selected #faffe6 (accent tint)
|
|
85
|
+
: theme.colors.background.default,
|
|
86
|
+
...(selected
|
|
87
|
+
? {
|
|
88
|
+
boxShadow: [
|
|
89
|
+
{
|
|
90
|
+
offsetX: 0,
|
|
91
|
+
offsetY: 0,
|
|
92
|
+
blurRadius: 0,
|
|
93
|
+
spreadDistance: 6,
|
|
94
|
+
color: 'rgba(201, 255, 0, 0.15)',
|
|
95
|
+
},
|
|
96
|
+
] as ViewStyle['boxShadow'],
|
|
97
|
+
}
|
|
98
|
+
: null),
|
|
99
|
+
opacity: disabled ? 0.5 : 1,
|
|
100
|
+
};
|
|
101
|
+
}, [theme, selected, disabled]);
|
|
102
|
+
|
|
103
|
+
const content = (
|
|
104
|
+
<>
|
|
105
|
+
{icon ? <Icon name={icon} size={24} color="primary" /> : null}
|
|
106
|
+
{title ? (
|
|
107
|
+
<Text variant="h3" weight="semibold" color="primary" numberOfLines={1}>
|
|
108
|
+
{title}
|
|
109
|
+
</Text>
|
|
110
|
+
) : null}
|
|
111
|
+
{description ? (
|
|
112
|
+
<Text variant="bodyMedium" color="tertiary">
|
|
113
|
+
{description}
|
|
114
|
+
</Text>
|
|
115
|
+
) : null}
|
|
116
|
+
{children}
|
|
117
|
+
{showRadio ? (
|
|
118
|
+
<View style={{ position: 'absolute', top: 24, right: 24 }}>
|
|
119
|
+
<Radio selected={selected} theme={theme} />
|
|
120
|
+
</View>
|
|
121
|
+
) : null}
|
|
122
|
+
</>
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
if (!onPress) {
|
|
126
|
+
return <View style={[baseStyle, style]}>{content}</View>;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<Pressable
|
|
131
|
+
accessibilityRole="button"
|
|
132
|
+
accessibilityState={{ selected, disabled }}
|
|
133
|
+
accessibilityLabel={accessibilityLabel ?? title}
|
|
134
|
+
disabled={disabled}
|
|
135
|
+
onPress={onPress}
|
|
136
|
+
style={({ pressed }: PressableStateCallbackType) => [
|
|
137
|
+
baseStyle,
|
|
138
|
+
{ opacity: disabled ? 0.5 : pressed ? 0.96 : 1 },
|
|
139
|
+
style,
|
|
140
|
+
]}
|
|
141
|
+
>
|
|
142
|
+
{content}
|
|
143
|
+
</Pressable>
|
|
144
|
+
);
|
|
145
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Card, type CardProps } from './Card';
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { View, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import { useTheme } from '../../theme';
|
|
3
|
+
import { Icon } from '../Icon/Icon';
|
|
4
|
+
import { Labeled, type LabelPosition } from '../_internal/Labeled';
|
|
5
|
+
|
|
6
|
+
export interface CheckboxProps {
|
|
7
|
+
/** Checked state. */
|
|
8
|
+
checked: boolean;
|
|
9
|
+
/** Called with the next checked value when pressed. */
|
|
10
|
+
onChange: (checked: boolean) => void;
|
|
11
|
+
/** Show the indeterminate (mixed) mark instead of a check. */
|
|
12
|
+
indeterminate?: boolean;
|
|
13
|
+
/** Disable and dim the control. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Optional label. */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** Where the label sits: top / bottom / left / right. Defaults to `right`. */
|
|
18
|
+
labelPosition?: LabelPosition;
|
|
19
|
+
/** Override the container style. */
|
|
20
|
+
style?: StyleProp<ViewStyle>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Checkbox — faithful to the Bacon POS Figma "Form controls". 24px rounded box:
|
|
25
|
+
* unchecked (outlined), checked (dark fill + white check), indeterminate (dash).
|
|
26
|
+
* Standalone or with a positionable label.
|
|
27
|
+
*/
|
|
28
|
+
export function Checkbox({
|
|
29
|
+
checked,
|
|
30
|
+
onChange,
|
|
31
|
+
indeterminate = false,
|
|
32
|
+
disabled = false,
|
|
33
|
+
label,
|
|
34
|
+
labelPosition,
|
|
35
|
+
style,
|
|
36
|
+
}: CheckboxProps) {
|
|
37
|
+
const theme = useTheme();
|
|
38
|
+
const on = checked || indeterminate;
|
|
39
|
+
|
|
40
|
+
let backgroundColor: string;
|
|
41
|
+
let borderWidth = 0;
|
|
42
|
+
let borderColor = 'transparent';
|
|
43
|
+
let markColor = theme.colors.background.default;
|
|
44
|
+
|
|
45
|
+
if (disabled) {
|
|
46
|
+
backgroundColor = on ? theme.colors.disabled.backgroundStrong : theme.colors.disabled.background;
|
|
47
|
+
borderWidth = on ? 0 : 1;
|
|
48
|
+
borderColor = theme.colors.disabled.border;
|
|
49
|
+
markColor = theme.colors.disabled.foreground;
|
|
50
|
+
} else if (on) {
|
|
51
|
+
backgroundColor = theme.colors.text.primary;
|
|
52
|
+
} else {
|
|
53
|
+
backgroundColor = theme.colors.background.default;
|
|
54
|
+
borderWidth = 1;
|
|
55
|
+
borderColor = theme.colors.border.strong;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const mark = indeterminate ? 'minus' : checked ? 'check' : null;
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Labeled
|
|
62
|
+
label={label}
|
|
63
|
+
labelPosition={labelPosition}
|
|
64
|
+
disabled={disabled}
|
|
65
|
+
onPress={() => onChange(!checked)}
|
|
66
|
+
accessibilityRole="checkbox"
|
|
67
|
+
accessibilityState={{ checked: indeterminate ? 'mixed' : checked, disabled }}
|
|
68
|
+
style={style}
|
|
69
|
+
>
|
|
70
|
+
<View
|
|
71
|
+
style={{
|
|
72
|
+
width: 24,
|
|
73
|
+
height: 24,
|
|
74
|
+
borderRadius: theme.radii.md,
|
|
75
|
+
backgroundColor,
|
|
76
|
+
borderWidth,
|
|
77
|
+
borderColor,
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
justifyContent: 'center',
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
{mark ? <Icon name={mark} size={18} color={markColor} /> : null}
|
|
83
|
+
</View>
|
|
84
|
+
</Labeled>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Checkbox, type CheckboxProps } from './Checkbox';
|