@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
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Pressable, View, type PressableStateCallbackType, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import { useTheme } from '../../theme';
|
|
3
|
+
import type { RadiusToken } from '../../theme/spacing';
|
|
4
|
+
import type { TypographyVariant } from '../../theme/typography';
|
|
5
|
+
import { Icon } from '../Icon/Icon';
|
|
6
|
+
import type { IconName } from '../Icon/icons.generated';
|
|
7
|
+
import { Text } from '../Text/Text';
|
|
8
|
+
|
|
9
|
+
/** Highlight color when the chip is active. */
|
|
10
|
+
export type ChipTone = 'dark' | 'primary';
|
|
11
|
+
|
|
12
|
+
export type ChipSize = 'sm' | 'md';
|
|
13
|
+
|
|
14
|
+
const SIZES: Record<
|
|
15
|
+
ChipSize,
|
|
16
|
+
{ paddingH: number; paddingV: number; gap: number; text: TypographyVariant; icon: number; swatch: number; radius: RadiusToken }
|
|
17
|
+
> = {
|
|
18
|
+
sm: { paddingH: 12, paddingV: 6, gap: 6, text: 'bodySmall', icon: 16, swatch: 8, radius: 'md' },
|
|
19
|
+
md: { paddingH: 16, paddingV: 12, gap: 8, text: 'bodyMedium', icon: 20, swatch: 10, radius: 'lg' },
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export interface ChipProps {
|
|
23
|
+
/** Chip label. */
|
|
24
|
+
label: string;
|
|
25
|
+
/** Selected/on state — filled highlight, inverse text, swatch hidden. */
|
|
26
|
+
active?: boolean;
|
|
27
|
+
/** Toggle handler. */
|
|
28
|
+
onPress?: () => void;
|
|
29
|
+
/** Active highlight: `dark` (default) or `primary` (the Button-default action color). */
|
|
30
|
+
tone?: ChipTone;
|
|
31
|
+
/** Control size: `sm` or `md` (default). */
|
|
32
|
+
size?: ChipSize;
|
|
33
|
+
/**
|
|
34
|
+
* Color dot shown on the left (a legend/convention color). Hidden when
|
|
35
|
+
* `active` — the chip fills with the tone color instead.
|
|
36
|
+
*/
|
|
37
|
+
swatchColor?: string;
|
|
38
|
+
/** Optional left icon (shown in both states, tinted to the text color). */
|
|
39
|
+
icon?: IconName;
|
|
40
|
+
/** Show a check icon on the right while active. */
|
|
41
|
+
showCheck?: boolean;
|
|
42
|
+
/** Disable and dim. */
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
/** Override the container style. */
|
|
45
|
+
style?: StyleProp<ViewStyle>;
|
|
46
|
+
/** Accessibility label (defaults to `label`). */
|
|
47
|
+
accessibilityLabel?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Chip — faithful to the Bacon POS Figma "Chips". A selectable pill: default
|
|
52
|
+
* (light, secondary text) / active (filled, inverse text). Options: a left color
|
|
53
|
+
* swatch (a convention color) that hides when active, a left icon, a `primary`
|
|
54
|
+
* active tone, and a right check when selected.
|
|
55
|
+
*/
|
|
56
|
+
export function Chip({
|
|
57
|
+
label,
|
|
58
|
+
active = false,
|
|
59
|
+
onPress,
|
|
60
|
+
tone = 'dark',
|
|
61
|
+
size = 'md',
|
|
62
|
+
swatchColor,
|
|
63
|
+
icon,
|
|
64
|
+
showCheck = false,
|
|
65
|
+
disabled = false,
|
|
66
|
+
style,
|
|
67
|
+
accessibilityLabel,
|
|
68
|
+
}: ChipProps) {
|
|
69
|
+
const theme = useTheme();
|
|
70
|
+
const cfg = SIZES[size];
|
|
71
|
+
|
|
72
|
+
let backgroundColor = theme.colors.background.default;
|
|
73
|
+
let borderColor = theme.colors.border.default;
|
|
74
|
+
let contentColor = theme.colors.text.secondary;
|
|
75
|
+
if (active) {
|
|
76
|
+
if (tone === 'primary') {
|
|
77
|
+
// Same lime action color as the default Button.
|
|
78
|
+
backgroundColor = theme.colors.action.primary;
|
|
79
|
+
borderColor = theme.colors.action.primary;
|
|
80
|
+
contentColor = theme.colors.action.primaryForeground;
|
|
81
|
+
} else {
|
|
82
|
+
backgroundColor = theme.colors.text.primary;
|
|
83
|
+
borderColor = theme.colors.text.primary;
|
|
84
|
+
contentColor = theme.colors.text.inverse;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<Pressable
|
|
90
|
+
onPress={onPress}
|
|
91
|
+
disabled={disabled || !onPress}
|
|
92
|
+
accessibilityRole="button"
|
|
93
|
+
accessibilityState={{ selected: active, disabled }}
|
|
94
|
+
accessibilityLabel={accessibilityLabel ?? label}
|
|
95
|
+
style={({ pressed }: PressableStateCallbackType) => [
|
|
96
|
+
{
|
|
97
|
+
flexDirection: 'row',
|
|
98
|
+
alignItems: 'center',
|
|
99
|
+
alignSelf: 'flex-start',
|
|
100
|
+
gap: cfg.gap,
|
|
101
|
+
paddingHorizontal: cfg.paddingH,
|
|
102
|
+
paddingVertical: cfg.paddingV,
|
|
103
|
+
borderRadius: theme.radii[cfg.radius],
|
|
104
|
+
borderWidth: 1,
|
|
105
|
+
borderColor,
|
|
106
|
+
backgroundColor,
|
|
107
|
+
opacity: disabled ? 0.5 : pressed ? 0.9 : 1,
|
|
108
|
+
},
|
|
109
|
+
style,
|
|
110
|
+
]}
|
|
111
|
+
>
|
|
112
|
+
{icon ? (
|
|
113
|
+
<Icon name={icon} size={cfg.icon} color={contentColor} />
|
|
114
|
+
) : swatchColor && !active ? (
|
|
115
|
+
<View
|
|
116
|
+
testID="chip-swatch"
|
|
117
|
+
style={{ width: cfg.swatch, height: cfg.swatch, borderRadius: cfg.swatch / 2, backgroundColor: swatchColor }}
|
|
118
|
+
/>
|
|
119
|
+
) : null}
|
|
120
|
+
<Text variant={cfg.text} weight="medium" color={contentColor} numberOfLines={1}>
|
|
121
|
+
{label}
|
|
122
|
+
</Text>
|
|
123
|
+
{active && showCheck ? <Icon name="check" size={cfg.icon} color={contentColor} /> : null}
|
|
124
|
+
</Pressable>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { View, type StyleProp, type ViewStyle } from 'react-native';
|
|
2
|
+
import type { IconName } from '../Icon/icons.generated';
|
|
3
|
+
import { Chip, type ChipTone, type ChipSize } from './Chip';
|
|
4
|
+
|
|
5
|
+
export interface ChipOption {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
/** Left convention color dot (hidden when active). */
|
|
9
|
+
swatchColor?: string;
|
|
10
|
+
/** Left icon. */
|
|
11
|
+
icon?: IconName;
|
|
12
|
+
/** Disable just this option. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface ChipGroupBase {
|
|
17
|
+
options: ChipOption[];
|
|
18
|
+
/** Active highlight tone applied to all chips. */
|
|
19
|
+
tone?: ChipTone;
|
|
20
|
+
/** Size applied to all chips. */
|
|
21
|
+
size?: ChipSize;
|
|
22
|
+
/** Show a check on selected chips. */
|
|
23
|
+
showCheck?: boolean;
|
|
24
|
+
/** Disable the whole group. */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** Gap between chips. Defaults to 8. */
|
|
27
|
+
gap?: number;
|
|
28
|
+
/** Override the wrapper style. */
|
|
29
|
+
style?: StyleProp<ViewStyle>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface SingleSelect {
|
|
33
|
+
multiple?: false;
|
|
34
|
+
/** Selected value, or null when none. */
|
|
35
|
+
value: string | null;
|
|
36
|
+
onChange: (value: string | null) => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface MultiSelect {
|
|
40
|
+
multiple: true;
|
|
41
|
+
/** Selected values. */
|
|
42
|
+
value: string[];
|
|
43
|
+
onChange: (value: string[]) => void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type ChipGroupProps = ChipGroupBase & (SingleSelect | MultiSelect);
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* A wrapping row of Chips with single- or multi-select behavior. Set `multiple`
|
|
50
|
+
* to toggle several; otherwise selecting a chip replaces the selection (and
|
|
51
|
+
* re-tapping the active one clears it).
|
|
52
|
+
*/
|
|
53
|
+
export function ChipGroup(props: ChipGroupProps) {
|
|
54
|
+
const { options, tone, size, showCheck, disabled, gap = 8, style } = props;
|
|
55
|
+
|
|
56
|
+
const isSelected = (value: string) =>
|
|
57
|
+
props.multiple ? props.value.includes(value) : props.value === value;
|
|
58
|
+
|
|
59
|
+
const handlePress = (value: string) => {
|
|
60
|
+
if (props.multiple) {
|
|
61
|
+
const set = new Set(props.value);
|
|
62
|
+
if (set.has(value)) set.delete(value);
|
|
63
|
+
else set.add(value);
|
|
64
|
+
props.onChange(Array.from(set));
|
|
65
|
+
} else {
|
|
66
|
+
props.onChange(props.value === value ? null : value);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<View style={[{ flexDirection: 'row', flexWrap: 'wrap', gap }, style]}>
|
|
72
|
+
{options.map((option) => (
|
|
73
|
+
<Chip
|
|
74
|
+
key={option.value}
|
|
75
|
+
label={option.label}
|
|
76
|
+
swatchColor={option.swatchColor}
|
|
77
|
+
icon={option.icon}
|
|
78
|
+
tone={tone}
|
|
79
|
+
size={size}
|
|
80
|
+
showCheck={showCheck}
|
|
81
|
+
active={isSelected(option.value)}
|
|
82
|
+
disabled={disabled || option.disabled}
|
|
83
|
+
onPress={() => handlePress(option.value)}
|
|
84
|
+
/>
|
|
85
|
+
))}
|
|
86
|
+
</View>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
TextInput,
|
|
5
|
+
View,
|
|
6
|
+
type StyleProp,
|
|
7
|
+
type TextStyle,
|
|
8
|
+
type ViewStyle,
|
|
9
|
+
} from 'react-native';
|
|
10
|
+
import { useTheme, type Theme } from '../../theme';
|
|
11
|
+
import { Icon } from '../Icon/Icon';
|
|
12
|
+
import { Text } from '../Text/Text';
|
|
13
|
+
|
|
14
|
+
/** Removes the browser's default focus outline on web (no-op on native). */
|
|
15
|
+
const WEB_NO_OUTLINE = { outlineStyle: 'none', outlineWidth: 0 } as unknown as TextStyle;
|
|
16
|
+
|
|
17
|
+
/** Where the reveal (eye) toggle sits relative to the code cells. */
|
|
18
|
+
export type RevealPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
19
|
+
|
|
20
|
+
export interface CodeInputProps {
|
|
21
|
+
/** Current entered digits. */
|
|
22
|
+
value: string;
|
|
23
|
+
/** Called with the digits as they change (digits only, capped to `length`). */
|
|
24
|
+
onChangeText: (value: string) => void;
|
|
25
|
+
/** Number of cells. Defaults to 4. */
|
|
26
|
+
length?: number;
|
|
27
|
+
/** Called once all cells are filled. */
|
|
28
|
+
onComplete?: (value: string) => void;
|
|
29
|
+
/** Disable input and dim the cells. */
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Focus on mount. */
|
|
32
|
+
autoFocus?: boolean;
|
|
33
|
+
/** Show an eye toggle to reveal/hide the entered digits. */
|
|
34
|
+
revealable?: boolean;
|
|
35
|
+
/** Controlled reveal state. Omit for uncontrolled (toggled by the eye). */
|
|
36
|
+
revealed?: boolean;
|
|
37
|
+
/** Called when the eye toggle changes the reveal state. */
|
|
38
|
+
onRevealChange?: (revealed: boolean) => void;
|
|
39
|
+
/** Where the eye toggle sits. Defaults to `right`. */
|
|
40
|
+
revealPosition?: RevealPosition;
|
|
41
|
+
/** Accessibility label for the hidden field. Defaults to "Code". */
|
|
42
|
+
accessibilityLabel?: string;
|
|
43
|
+
/** Accessibility labels for the reveal toggle. */
|
|
44
|
+
revealLabel?: string;
|
|
45
|
+
hideLabel?: string;
|
|
46
|
+
/** Override the container style. */
|
|
47
|
+
style?: StyleProp<ViewStyle>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function Cell({
|
|
51
|
+
char,
|
|
52
|
+
filled,
|
|
53
|
+
revealed,
|
|
54
|
+
disabled,
|
|
55
|
+
theme,
|
|
56
|
+
}: {
|
|
57
|
+
char: string;
|
|
58
|
+
filled: boolean;
|
|
59
|
+
revealed: boolean;
|
|
60
|
+
disabled: boolean;
|
|
61
|
+
theme: Theme;
|
|
62
|
+
}) {
|
|
63
|
+
return (
|
|
64
|
+
<View
|
|
65
|
+
testID="code-input-cell"
|
|
66
|
+
style={{ width: 20, height: 20, alignItems: 'center', justifyContent: 'center' }}
|
|
67
|
+
>
|
|
68
|
+
{revealed && filled ? (
|
|
69
|
+
<Text variant="bodyMedium" weight="medium" color={disabled ? 'tertiary' : 'primary'}>
|
|
70
|
+
{char}
|
|
71
|
+
</Text>
|
|
72
|
+
) : (
|
|
73
|
+
<View
|
|
74
|
+
style={{
|
|
75
|
+
width: 20,
|
|
76
|
+
height: 20,
|
|
77
|
+
borderRadius: 10,
|
|
78
|
+
borderWidth: 1.5,
|
|
79
|
+
backgroundColor: filled ? theme.colors.text.primary : theme.colors.background.default,
|
|
80
|
+
borderColor: filled ? theme.colors.text.primary : theme.colors.border.strong,
|
|
81
|
+
opacity: disabled ? 0.5 : 1,
|
|
82
|
+
}}
|
|
83
|
+
/>
|
|
84
|
+
)}
|
|
85
|
+
</View>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Code / PIN input — faithful to the Bacon POS Figma "Acceso code input".
|
|
91
|
+
* Shows `length` cells that fill as digits are entered; a hidden numeric field
|
|
92
|
+
* captures input. With `revealable`, an eye toggle switches between hidden dots
|
|
93
|
+
* and the visible digits (position configurable). Controlled via
|
|
94
|
+
* `value` / `onChangeText`.
|
|
95
|
+
*/
|
|
96
|
+
export function CodeInput({
|
|
97
|
+
value,
|
|
98
|
+
onChangeText,
|
|
99
|
+
length = 4,
|
|
100
|
+
onComplete,
|
|
101
|
+
disabled = false,
|
|
102
|
+
autoFocus = false,
|
|
103
|
+
revealable = false,
|
|
104
|
+
revealed: revealedProp,
|
|
105
|
+
onRevealChange,
|
|
106
|
+
revealPosition = 'right',
|
|
107
|
+
accessibilityLabel = 'Code',
|
|
108
|
+
revealLabel = 'Show code',
|
|
109
|
+
hideLabel = 'Hide code',
|
|
110
|
+
style,
|
|
111
|
+
}: CodeInputProps) {
|
|
112
|
+
const theme = useTheme();
|
|
113
|
+
const inputRef = useRef<TextInput>(null);
|
|
114
|
+
const [internalRevealed, setInternalRevealed] = useState(false);
|
|
115
|
+
const revealed = revealedProp ?? internalRevealed;
|
|
116
|
+
const filled = Math.min(value.length, length);
|
|
117
|
+
|
|
118
|
+
const handleChange = (text: string) => {
|
|
119
|
+
const digits = text.replace(/[^0-9]/g, '').slice(0, length);
|
|
120
|
+
onChangeText(digits);
|
|
121
|
+
if (digits.length === length) onComplete?.(digits);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const toggleReveal = () => {
|
|
125
|
+
const next = !revealed;
|
|
126
|
+
onRevealChange?.(next);
|
|
127
|
+
if (revealedProp === undefined) setInternalRevealed(next);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const cells = (
|
|
131
|
+
<Pressable
|
|
132
|
+
onPress={() => inputRef.current?.focus()}
|
|
133
|
+
disabled={disabled}
|
|
134
|
+
style={{ position: 'relative' }}
|
|
135
|
+
>
|
|
136
|
+
<View style={{ flexDirection: 'row', gap: 16, alignItems: 'center', justifyContent: 'center' }}>
|
|
137
|
+
{Array.from({ length }).map((_, i) => (
|
|
138
|
+
<Cell
|
|
139
|
+
key={i}
|
|
140
|
+
char={value[i] ?? ''}
|
|
141
|
+
filled={i < filled}
|
|
142
|
+
revealed={revealed}
|
|
143
|
+
disabled={disabled}
|
|
144
|
+
theme={theme}
|
|
145
|
+
/>
|
|
146
|
+
))}
|
|
147
|
+
</View>
|
|
148
|
+
<TextInput
|
|
149
|
+
ref={inputRef}
|
|
150
|
+
value={value}
|
|
151
|
+
onChangeText={handleChange}
|
|
152
|
+
keyboardType="number-pad"
|
|
153
|
+
maxLength={length}
|
|
154
|
+
editable={!disabled}
|
|
155
|
+
caretHidden
|
|
156
|
+
autoFocus={autoFocus}
|
|
157
|
+
accessibilityLabel={accessibilityLabel}
|
|
158
|
+
style={[
|
|
159
|
+
{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, opacity: 0 },
|
|
160
|
+
WEB_NO_OUTLINE,
|
|
161
|
+
]}
|
|
162
|
+
/>
|
|
163
|
+
</Pressable>
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
const eyeToggle = revealable ? (
|
|
167
|
+
<Pressable
|
|
168
|
+
onPress={toggleReveal}
|
|
169
|
+
disabled={disabled}
|
|
170
|
+
hitSlop={8}
|
|
171
|
+
accessibilityRole="button"
|
|
172
|
+
accessibilityLabel={revealed ? hideLabel : revealLabel}
|
|
173
|
+
style={{ padding: 4, opacity: disabled ? 0.5 : 1 }}
|
|
174
|
+
>
|
|
175
|
+
<Icon name={revealed ? 'eye' : 'eye-hide'} size={24} color="secondary" />
|
|
176
|
+
</Pressable>
|
|
177
|
+
) : null;
|
|
178
|
+
|
|
179
|
+
const vertical = revealPosition === 'top' || revealPosition === 'bottom';
|
|
180
|
+
const eyeFirst = revealPosition === 'top' || revealPosition === 'left';
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<View
|
|
184
|
+
style={[
|
|
185
|
+
{
|
|
186
|
+
flexDirection: vertical ? 'column' : 'row',
|
|
187
|
+
alignItems: 'center',
|
|
188
|
+
gap: 12,
|
|
189
|
+
alignSelf: 'flex-start',
|
|
190
|
+
paddingVertical: 8,
|
|
191
|
+
},
|
|
192
|
+
style,
|
|
193
|
+
]}
|
|
194
|
+
>
|
|
195
|
+
{eyeFirst ? eyeToggle : null}
|
|
196
|
+
{cells}
|
|
197
|
+
{eyeFirst ? null : eyeToggle}
|
|
198
|
+
</View>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CodeInput, type CodeInputProps } from './CodeInput';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SvgXml } from 'react-native-svg';
|
|
2
|
+
import { useTheme } from '../../theme';
|
|
3
|
+
import { icons, type IconName } from './icons.generated';
|
|
4
|
+
|
|
5
|
+
type IconColorToken = keyof ReturnType<typeof useTheme>['colors']['text'];
|
|
6
|
+
|
|
7
|
+
export interface IconProps {
|
|
8
|
+
/** Icon name from the generated registry. */
|
|
9
|
+
name: IconName;
|
|
10
|
+
/** Square size in px. Defaults to 24. */
|
|
11
|
+
size?: number;
|
|
12
|
+
/** Semantic text color token, or any raw color string. Defaults to `primary`. */
|
|
13
|
+
color?: IconColorToken | (string & {});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Renders a design-system icon as a themeable SVG. The source SVG is rendered
|
|
18
|
+
* faithfully via react-native-svg's <SvgXml> (stroke icons stay stroked,
|
|
19
|
+
* compound fills keep their holes) and tinted through `currentColor`.
|
|
20
|
+
*/
|
|
21
|
+
export function Icon({ name, size = 24, color = 'primary' }: IconProps) {
|
|
22
|
+
const theme = useTheme();
|
|
23
|
+
const xml = icons[name] as string | undefined;
|
|
24
|
+
if (!xml) return null;
|
|
25
|
+
|
|
26
|
+
const tint =
|
|
27
|
+
color in theme.colors.text
|
|
28
|
+
? theme.colors.text[color as IconColorToken]
|
|
29
|
+
: (color as string);
|
|
30
|
+
|
|
31
|
+
return <SvgXml xml={xml} width={size} height={size} color={tint} />;
|
|
32
|
+
}
|