@objectifthunes/limestone-sdk 0.1.4 → 0.1.5
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/dist/animations/index.d.ts +2 -0
- package/dist/animations/index.d.ts.map +1 -1
- package/dist/animations/index.js +1 -0
- package/dist/animations/index.js.map +1 -1
- package/dist/animations/shimmer/index.d.ts +4 -0
- package/dist/animations/shimmer/index.d.ts.map +1 -0
- package/dist/animations/shimmer/index.js +3 -0
- package/dist/animations/shimmer/index.js.map +1 -0
- package/dist/animations/shimmer/shimmer.d.ts +6 -0
- package/dist/animations/shimmer/shimmer.d.ts.map +1 -0
- package/dist/animations/shimmer/shimmer.js +19 -0
- package/dist/animations/shimmer/shimmer.js.map +1 -0
- package/dist/animations/shimmer/types.d.ts +34 -0
- package/dist/animations/shimmer/types.d.ts.map +1 -0
- package/dist/animations/shimmer/types.js +2 -0
- package/dist/animations/shimmer/types.js.map +1 -0
- package/dist/animations/shimmer/use-shimmer.d.ts +4 -0
- package/dist/animations/shimmer/use-shimmer.d.ts.map +1 -0
- package/dist/animations/shimmer/use-shimmer.js +61 -0
- package/dist/animations/shimmer/use-shimmer.js.map +1 -0
- package/dist/components/data-display/index.d.ts +8 -0
- package/dist/components/data-display/index.d.ts.map +1 -1
- package/dist/components/data-display/index.js +4 -0
- package/dist/components/data-display/index.js.map +1 -1
- package/dist/components/data-display/key-value-row/index.d.ts +4 -0
- package/dist/components/data-display/key-value-row/index.d.ts.map +1 -0
- package/dist/components/data-display/key-value-row/index.js +4 -0
- package/dist/components/data-display/key-value-row/index.js.map +1 -0
- package/dist/components/data-display/key-value-row/key-value-row.d.ts +4 -0
- package/dist/components/data-display/key-value-row/key-value-row.d.ts.map +1 -0
- package/dist/components/data-display/key-value-row/key-value-row.js +15 -0
- package/dist/components/data-display/key-value-row/key-value-row.js.map +1 -0
- package/dist/components/data-display/key-value-row/types.d.ts +36 -0
- package/dist/components/data-display/key-value-row/types.d.ts.map +1 -0
- package/dist/components/data-display/key-value-row/types.js +2 -0
- package/dist/components/data-display/key-value-row/types.js.map +1 -0
- package/dist/components/data-display/key-value-row/use-key-value-row.d.ts +4 -0
- package/dist/components/data-display/key-value-row/use-key-value-row.d.ts.map +1 -0
- package/dist/components/data-display/key-value-row/use-key-value-row.js +59 -0
- package/dist/components/data-display/key-value-row/use-key-value-row.js.map +1 -0
- package/dist/components/data-display/list-item/index.d.ts +4 -0
- package/dist/components/data-display/list-item/index.d.ts.map +1 -0
- package/dist/components/data-display/list-item/index.js +4 -0
- package/dist/components/data-display/list-item/index.js.map +1 -0
- package/dist/components/data-display/list-item/list-item.d.ts +4 -0
- package/dist/components/data-display/list-item/list-item.d.ts.map +1 -0
- package/dist/components/data-display/list-item/list-item.js +25 -0
- package/dist/components/data-display/list-item/list-item.js.map +1 -0
- package/dist/components/data-display/list-item/types.d.ts +57 -0
- package/dist/components/data-display/list-item/types.d.ts.map +1 -0
- package/dist/components/data-display/list-item/types.js +2 -0
- package/dist/components/data-display/list-item/types.js.map +1 -0
- package/dist/components/data-display/list-item/use-list-item.d.ts +4 -0
- package/dist/components/data-display/list-item/use-list-item.d.ts.map +1 -0
- package/dist/components/data-display/list-item/use-list-item.js +68 -0
- package/dist/components/data-display/list-item/use-list-item.js.map +1 -0
- package/dist/components/data-display/price-display/index.d.ts +4 -0
- package/dist/components/data-display/price-display/index.d.ts.map +1 -0
- package/dist/components/data-display/price-display/index.js +4 -0
- package/dist/components/data-display/price-display/index.js.map +1 -0
- package/dist/components/data-display/price-display/price-display.d.ts +4 -0
- package/dist/components/data-display/price-display/price-display.d.ts.map +1 -0
- package/dist/components/data-display/price-display/price-display.js +20 -0
- package/dist/components/data-display/price-display/price-display.js.map +1 -0
- package/dist/components/data-display/price-display/types.d.ts +34 -0
- package/dist/components/data-display/price-display/types.d.ts.map +1 -0
- package/dist/components/data-display/price-display/types.js +2 -0
- package/dist/components/data-display/price-display/types.js.map +1 -0
- package/dist/components/data-display/price-display/use-price-display.d.ts +4 -0
- package/dist/components/data-display/price-display/use-price-display.d.ts.map +1 -0
- package/dist/components/data-display/price-display/use-price-display.js +78 -0
- package/dist/components/data-display/price-display/use-price-display.js.map +1 -0
- package/dist/components/data-display/rating-stars/index.d.ts +4 -0
- package/dist/components/data-display/rating-stars/index.d.ts.map +1 -0
- package/dist/components/data-display/rating-stars/index.js +4 -0
- package/dist/components/data-display/rating-stars/index.js.map +1 -0
- package/dist/components/data-display/rating-stars/rating-stars.d.ts +4 -0
- package/dist/components/data-display/rating-stars/rating-stars.d.ts.map +1 -0
- package/dist/components/data-display/rating-stars/rating-stars.js +24 -0
- package/dist/components/data-display/rating-stars/rating-stars.js.map +1 -0
- package/dist/components/data-display/rating-stars/types.d.ts +45 -0
- package/dist/components/data-display/rating-stars/types.d.ts.map +1 -0
- package/dist/components/data-display/rating-stars/types.js +2 -0
- package/dist/components/data-display/rating-stars/types.js.map +1 -0
- package/dist/components/data-display/rating-stars/use-rating-stars.d.ts +4 -0
- package/dist/components/data-display/rating-stars/use-rating-stars.d.ts.map +1 -0
- package/dist/components/data-display/rating-stars/use-rating-stars.js +64 -0
- package/dist/components/data-display/rating-stars/use-rating-stars.js.map +1 -0
- package/dist/components/feedback/connection-status/connection-status.d.ts +4 -0
- package/dist/components/feedback/connection-status/connection-status.d.ts.map +1 -0
- package/dist/components/feedback/connection-status/connection-status.js +10 -0
- package/dist/components/feedback/connection-status/connection-status.js.map +1 -0
- package/dist/components/feedback/connection-status/index.d.ts +4 -0
- package/dist/components/feedback/connection-status/index.d.ts.map +1 -0
- package/dist/components/feedback/connection-status/index.js +3 -0
- package/dist/components/feedback/connection-status/index.js.map +1 -0
- package/dist/components/feedback/connection-status/types.d.ts +33 -0
- package/dist/components/feedback/connection-status/types.d.ts.map +1 -0
- package/dist/components/feedback/connection-status/types.js +2 -0
- package/dist/components/feedback/connection-status/types.js.map +1 -0
- package/dist/components/feedback/connection-status/use-connection-status.d.ts +4 -0
- package/dist/components/feedback/connection-status/use-connection-status.d.ts.map +1 -0
- package/dist/components/feedback/connection-status/use-connection-status.js +79 -0
- package/dist/components/feedback/connection-status/use-connection-status.js.map +1 -0
- package/dist/components/feedback/index.d.ts +2 -0
- package/dist/components/feedback/index.d.ts.map +1 -1
- package/dist/components/feedback/index.js +1 -0
- package/dist/components/feedback/index.js.map +1 -1
- package/dist/components/index.d.ts +14 -10
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +8 -5
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs/autocomplete/autocomplete.d.ts +4 -0
- package/dist/components/inputs/autocomplete/autocomplete.d.ts.map +1 -0
- package/dist/components/inputs/autocomplete/autocomplete.js +166 -0
- package/dist/components/inputs/autocomplete/autocomplete.js.map +1 -0
- package/dist/components/inputs/autocomplete/index.d.ts +4 -0
- package/dist/components/inputs/autocomplete/index.d.ts.map +1 -0
- package/dist/components/inputs/autocomplete/index.js +3 -0
- package/dist/components/inputs/autocomplete/index.js.map +1 -0
- package/dist/components/inputs/autocomplete/types.d.ts +66 -0
- package/dist/components/inputs/autocomplete/types.d.ts.map +1 -0
- package/dist/components/inputs/autocomplete/types.js +2 -0
- package/dist/components/inputs/autocomplete/types.js.map +1 -0
- package/dist/components/inputs/autocomplete/use-autocomplete.d.ts +4 -0
- package/dist/components/inputs/autocomplete/use-autocomplete.d.ts.map +1 -0
- package/dist/components/inputs/autocomplete/use-autocomplete.js +173 -0
- package/dist/components/inputs/autocomplete/use-autocomplete.js.map +1 -0
- package/dist/components/inputs/chip/chip.d.ts +4 -0
- package/dist/components/inputs/chip/chip.d.ts.map +1 -0
- package/dist/components/inputs/chip/chip.js +29 -0
- package/dist/components/inputs/chip/chip.js.map +1 -0
- package/dist/components/inputs/chip/index.d.ts +4 -0
- package/dist/components/inputs/chip/index.d.ts.map +1 -0
- package/dist/components/inputs/chip/index.js +3 -0
- package/dist/components/inputs/chip/index.js.map +1 -0
- package/dist/components/inputs/chip/types.d.ts +35 -0
- package/dist/components/inputs/chip/types.d.ts.map +1 -0
- package/dist/components/inputs/chip/types.js +2 -0
- package/dist/components/inputs/chip/types.js.map +1 -0
- package/dist/components/inputs/chip/use-chip.d.ts +4 -0
- package/dist/components/inputs/chip/use-chip.d.ts.map +1 -0
- package/dist/components/inputs/chip/use-chip.js +80 -0
- package/dist/components/inputs/chip/use-chip.js.map +1 -0
- package/dist/components/inputs/chip-input/chip-input.d.ts +4 -0
- package/dist/components/inputs/chip-input/chip-input.d.ts.map +1 -0
- package/dist/components/inputs/chip-input/chip-input.js +117 -0
- package/dist/components/inputs/chip-input/chip-input.js.map +1 -0
- package/dist/components/inputs/chip-input/index.d.ts +4 -0
- package/dist/components/inputs/chip-input/index.d.ts.map +1 -0
- package/dist/components/inputs/chip-input/index.js +3 -0
- package/dist/components/inputs/chip-input/index.js.map +1 -0
- package/dist/components/inputs/chip-input/types.d.ts +40 -0
- package/dist/components/inputs/chip-input/types.d.ts.map +1 -0
- package/dist/components/inputs/chip-input/types.js +2 -0
- package/dist/components/inputs/chip-input/types.js.map +1 -0
- package/dist/components/inputs/chip-input/use-chip-input.d.ts +4 -0
- package/dist/components/inputs/chip-input/use-chip-input.d.ts.map +1 -0
- package/dist/components/inputs/chip-input/use-chip-input.js +106 -0
- package/dist/components/inputs/chip-input/use-chip-input.js.map +1 -0
- package/dist/components/inputs/index.d.ts +8 -0
- package/dist/components/inputs/index.d.ts.map +1 -1
- package/dist/components/inputs/index.js +4 -0
- package/dist/components/inputs/index.js.map +1 -1
- package/dist/components/inputs/quantity-picker/index.d.ts +4 -0
- package/dist/components/inputs/quantity-picker/index.d.ts.map +1 -0
- package/dist/components/inputs/quantity-picker/index.js +3 -0
- package/dist/components/inputs/quantity-picker/index.js.map +1 -0
- package/dist/components/inputs/quantity-picker/quantity-picker.d.ts +4 -0
- package/dist/components/inputs/quantity-picker/quantity-picker.d.ts.map +1 -0
- package/dist/components/inputs/quantity-picker/quantity-picker.js +43 -0
- package/dist/components/inputs/quantity-picker/quantity-picker.js.map +1 -0
- package/dist/components/inputs/quantity-picker/types.d.ts +39 -0
- package/dist/components/inputs/quantity-picker/types.d.ts.map +1 -0
- package/dist/components/inputs/quantity-picker/types.js +2 -0
- package/dist/components/inputs/quantity-picker/types.js.map +1 -0
- package/dist/components/inputs/quantity-picker/use-quantity-picker.d.ts +4 -0
- package/dist/components/inputs/quantity-picker/use-quantity-picker.d.ts.map +1 -0
- package/dist/components/inputs/quantity-picker/use-quantity-picker.js +73 -0
- package/dist/components/inputs/quantity-picker/use-quantity-picker.js.map +1 -0
- package/dist/components/interactive/index.d.ts +3 -0
- package/dist/components/interactive/index.d.ts.map +1 -0
- package/dist/components/interactive/index.js +2 -0
- package/dist/components/interactive/index.js.map +1 -0
- package/dist/components/interactive/swipeable-row/index.d.ts +4 -0
- package/dist/components/interactive/swipeable-row/index.d.ts.map +1 -0
- package/dist/components/interactive/swipeable-row/index.js +3 -0
- package/dist/components/interactive/swipeable-row/index.js.map +1 -0
- package/dist/components/interactive/swipeable-row/swipeable-row.d.ts +8 -0
- package/dist/components/interactive/swipeable-row/swipeable-row.d.ts.map +1 -0
- package/dist/components/interactive/swipeable-row/swipeable-row.js +16 -0
- package/dist/components/interactive/swipeable-row/swipeable-row.js.map +1 -0
- package/dist/components/interactive/swipeable-row/types.d.ts +37 -0
- package/dist/components/interactive/swipeable-row/types.d.ts.map +1 -0
- package/dist/components/interactive/swipeable-row/types.js +2 -0
- package/dist/components/interactive/swipeable-row/types.js.map +1 -0
- package/dist/components/interactive/swipeable-row/use-swipeable-row.d.ts +4 -0
- package/dist/components/interactive/swipeable-row/use-swipeable-row.d.ts.map +1 -0
- package/dist/components/interactive/swipeable-row/use-swipeable-row.js +52 -0
- package/dist/components/interactive/swipeable-row/use-swipeable-row.js.map +1 -0
- package/dist/components/navigation/collapsible-header/collapsible-header.d.ts +4 -0
- package/dist/components/navigation/collapsible-header/collapsible-header.d.ts.map +1 -0
- package/dist/components/navigation/collapsible-header/collapsible-header.js +14 -0
- package/dist/components/navigation/collapsible-header/collapsible-header.js.map +1 -0
- package/dist/components/navigation/collapsible-header/index.d.ts +4 -0
- package/dist/components/navigation/collapsible-header/index.d.ts.map +1 -0
- package/dist/components/navigation/collapsible-header/index.js +3 -0
- package/dist/components/navigation/collapsible-header/index.js.map +1 -0
- package/dist/components/navigation/collapsible-header/types.d.ts +37 -0
- package/dist/components/navigation/collapsible-header/types.d.ts.map +1 -0
- package/dist/components/navigation/collapsible-header/types.js +2 -0
- package/dist/components/navigation/collapsible-header/types.js.map +1 -0
- package/dist/components/navigation/collapsible-header/use-collapsible-header.d.ts +4 -0
- package/dist/components/navigation/collapsible-header/use-collapsible-header.d.ts.map +1 -0
- package/dist/components/navigation/collapsible-header/use-collapsible-header.js +58 -0
- package/dist/components/navigation/collapsible-header/use-collapsible-header.js.map +1 -0
- package/dist/components/navigation/index.d.ts +6 -0
- package/dist/components/navigation/index.d.ts.map +1 -1
- package/dist/components/navigation/index.js +3 -0
- package/dist/components/navigation/index.js.map +1 -1
- package/dist/components/navigation/page-indicator/index.d.ts +4 -0
- package/dist/components/navigation/page-indicator/index.d.ts.map +1 -0
- package/dist/components/navigation/page-indicator/index.js +4 -0
- package/dist/components/navigation/page-indicator/index.js.map +1 -0
- package/dist/components/navigation/page-indicator/page-indicator.d.ts +4 -0
- package/dist/components/navigation/page-indicator/page-indicator.d.ts.map +1 -0
- package/dist/components/navigation/page-indicator/page-indicator.js +29 -0
- package/dist/components/navigation/page-indicator/page-indicator.js.map +1 -0
- package/dist/components/navigation/page-indicator/types.d.ts +32 -0
- package/dist/components/navigation/page-indicator/types.d.ts.map +1 -0
- package/dist/components/navigation/page-indicator/types.js +2 -0
- package/dist/components/navigation/page-indicator/types.js.map +1 -0
- package/dist/components/navigation/page-indicator/use-page-indicator.d.ts +4 -0
- package/dist/components/navigation/page-indicator/use-page-indicator.d.ts.map +1 -0
- package/dist/components/navigation/page-indicator/use-page-indicator.js +69 -0
- package/dist/components/navigation/page-indicator/use-page-indicator.js.map +1 -0
- package/dist/components/navigation/tabs/index.d.ts +4 -0
- package/dist/components/navigation/tabs/index.d.ts.map +1 -0
- package/dist/components/navigation/tabs/index.js +3 -0
- package/dist/components/navigation/tabs/index.js.map +1 -0
- package/dist/components/navigation/tabs/tabs.d.ts +4 -0
- package/dist/components/navigation/tabs/tabs.d.ts.map +1 -0
- package/dist/components/navigation/tabs/tabs.js +19 -0
- package/dist/components/navigation/tabs/tabs.js.map +1 -0
- package/dist/components/navigation/tabs/types.d.ts +49 -0
- package/dist/components/navigation/tabs/types.d.ts.map +1 -0
- package/dist/components/navigation/tabs/types.js +2 -0
- package/dist/components/navigation/tabs/types.js.map +1 -0
- package/dist/components/navigation/tabs/use-tabs.d.ts +4 -0
- package/dist/components/navigation/tabs/use-tabs.d.ts.map +1 -0
- package/dist/components/navigation/tabs/use-tabs.js +157 -0
- package/dist/components/navigation/tabs/use-tabs.js.map +1 -0
- package/dist/components/overlays/context-menu/context-menu.d.ts +9 -0
- package/dist/components/overlays/context-menu/context-menu.d.ts.map +1 -0
- package/dist/components/overlays/context-menu/context-menu.js +35 -0
- package/dist/components/overlays/context-menu/context-menu.js.map +1 -0
- package/dist/components/overlays/context-menu/index.d.ts +4 -0
- package/dist/components/overlays/context-menu/index.d.ts.map +1 -0
- package/dist/components/overlays/context-menu/index.js +3 -0
- package/dist/components/overlays/context-menu/index.js.map +1 -0
- package/dist/components/overlays/context-menu/types.d.ts +34 -0
- package/dist/components/overlays/context-menu/types.d.ts.map +1 -0
- package/dist/components/overlays/context-menu/types.js +2 -0
- package/dist/components/overlays/context-menu/types.js.map +1 -0
- package/dist/components/overlays/context-menu/use-context-menu.d.ts +4 -0
- package/dist/components/overlays/context-menu/use-context-menu.d.ts.map +1 -0
- package/dist/components/overlays/context-menu/use-context-menu.js +76 -0
- package/dist/components/overlays/context-menu/use-context-menu.js.map +1 -0
- package/dist/components/overlays/index.d.ts +2 -0
- package/dist/components/overlays/index.d.ts.map +1 -1
- package/dist/components/overlays/index.js +1 -0
- package/dist/components/overlays/index.js.map +1 -1
- package/dist/components/primitives/button/button.d.ts +4 -0
- package/dist/components/primitives/button/button.d.ts.map +1 -0
- package/dist/components/primitives/button/button.js +65 -0
- package/dist/components/primitives/button/button.js.map +1 -0
- package/dist/components/primitives/button/index.d.ts +4 -0
- package/dist/components/primitives/button/index.d.ts.map +1 -0
- package/dist/components/primitives/button/index.js +3 -0
- package/dist/components/primitives/button/index.js.map +1 -0
- package/dist/components/primitives/button/types.d.ts +49 -0
- package/dist/components/primitives/button/types.d.ts.map +1 -0
- package/dist/components/primitives/button/types.js +2 -0
- package/dist/components/primitives/button/types.js.map +1 -0
- package/dist/components/primitives/button/use-button.d.ts +4 -0
- package/dist/components/primitives/button/use-button.d.ts.map +1 -0
- package/dist/components/primitives/button/use-button.js +86 -0
- package/dist/components/primitives/button/use-button.js.map +1 -0
- package/dist/components/primitives/icon-button/icon-button.d.ts +4 -0
- package/dist/components/primitives/icon-button/icon-button.d.ts.map +1 -0
- package/dist/components/primitives/icon-button/icon-button.js +66 -0
- package/dist/components/primitives/icon-button/icon-button.js.map +1 -0
- package/dist/components/primitives/icon-button/index.d.ts +4 -0
- package/dist/components/primitives/icon-button/index.d.ts.map +1 -0
- package/dist/components/primitives/icon-button/index.js +3 -0
- package/dist/components/primitives/icon-button/index.js.map +1 -0
- package/dist/components/primitives/icon-button/types.d.ts +45 -0
- package/dist/components/primitives/icon-button/types.d.ts.map +1 -0
- package/dist/components/primitives/icon-button/types.js +2 -0
- package/dist/components/primitives/icon-button/types.js.map +1 -0
- package/dist/components/primitives/icon-button/use-icon-button.d.ts +4 -0
- package/dist/components/primitives/icon-button/use-icon-button.d.ts.map +1 -0
- package/dist/components/primitives/icon-button/use-icon-button.js +57 -0
- package/dist/components/primitives/icon-button/use-icon-button.js.map +1 -0
- package/dist/components/primitives/index.d.ts +6 -0
- package/dist/components/primitives/index.d.ts.map +1 -1
- package/dist/components/primitives/index.js +3 -0
- package/dist/components/primitives/index.js.map +1 -1
- package/dist/components/primitives/link/index.d.ts +4 -0
- package/dist/components/primitives/link/index.d.ts.map +1 -0
- package/dist/components/primitives/link/index.js +3 -0
- package/dist/components/primitives/link/index.js.map +1 -0
- package/dist/components/primitives/link/link.d.ts +4 -0
- package/dist/components/primitives/link/link.d.ts.map +1 -0
- package/dist/components/primitives/link/link.js +43 -0
- package/dist/components/primitives/link/link.js.map +1 -0
- package/dist/components/primitives/link/types.d.ts +39 -0
- package/dist/components/primitives/link/types.d.ts.map +1 -0
- package/dist/components/primitives/link/types.js +2 -0
- package/dist/components/primitives/link/types.js.map +1 -0
- package/dist/components/primitives/link/use-link.d.ts +4 -0
- package/dist/components/primitives/link/use-link.d.ts.map +1 -0
- package/dist/components/primitives/link/use-link.js +27 -0
- package/dist/components/primitives/link/use-link.js.map +1 -0
- package/dist/components/use-component-style.d.ts +3 -0
- package/dist/components/use-component-style.d.ts.map +1 -1
- package/dist/components/use-component-style.js.map +1 -1
- package/dist/index.d.ts +19 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { resolveBoxStyle } from '../../use-component-style.js';
|
|
2
|
+
const SIZE_MAP = {
|
|
3
|
+
sm: { minHeight: 36, fontSize: 14, paddingKey: 'sm' },
|
|
4
|
+
md: { minHeight: 44, fontSize: 16, paddingKey: 'md' },
|
|
5
|
+
lg: { minHeight: 52, fontSize: 18, paddingKey: 'md' },
|
|
6
|
+
};
|
|
7
|
+
export function useChipInput(tokens, props) {
|
|
8
|
+
const { values, maxValues, disabled = false, focused, size = 'md', variant = 'outline', error, accessibilityLabel, testID, bg, p, px, py, pt, pb, pl, pr, m, mx, my, mt, mb, ml, mr, rounded, shadow, flex, row, center, w, h, borderWidth, borderColor, opacity, overflow, position, top, bottom, left, right, zIndex, } = props;
|
|
9
|
+
const sizeConfig = SIZE_MAP[size];
|
|
10
|
+
const isFull = maxValues !== undefined && values.length >= maxValues;
|
|
11
|
+
const boxShorthand = resolveBoxStyle(tokens, {
|
|
12
|
+
bg, p, px, py, pt, pb, pl, pr,
|
|
13
|
+
m, mx, my, mt, mb, ml, mr,
|
|
14
|
+
rounded, shadow, flex, row, center,
|
|
15
|
+
w, h, borderWidth, borderColor, opacity,
|
|
16
|
+
overflow, position, top, bottom, left, right, zIndex,
|
|
17
|
+
});
|
|
18
|
+
let resolvedBorderColor;
|
|
19
|
+
if (error) {
|
|
20
|
+
resolvedBorderColor = tokens.colors.destructive;
|
|
21
|
+
}
|
|
22
|
+
else if (focused) {
|
|
23
|
+
resolvedBorderColor = variant === 'underline' ? tokens.colors.primary : tokens.colors.ring;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
resolvedBorderColor = tokens.colors.border;
|
|
27
|
+
}
|
|
28
|
+
const containerStyle = {
|
|
29
|
+
...boxShorthand,
|
|
30
|
+
minHeight: sizeConfig.minHeight,
|
|
31
|
+
borderRadius: variant === 'underline' ? 0 : tokens.radii.md,
|
|
32
|
+
};
|
|
33
|
+
if (variant === 'outline') {
|
|
34
|
+
containerStyle.borderWidth = 1;
|
|
35
|
+
containerStyle.borderColor = resolvedBorderColor;
|
|
36
|
+
}
|
|
37
|
+
else if (variant === 'filled') {
|
|
38
|
+
containerStyle.backgroundColor = tokens.colors.input;
|
|
39
|
+
if (focused || error) {
|
|
40
|
+
containerStyle.borderWidth = 1;
|
|
41
|
+
containerStyle.borderColor = resolvedBorderColor;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else if (variant === 'underline') {
|
|
45
|
+
containerStyle.borderBottomWidth = 1;
|
|
46
|
+
containerStyle.borderColor = resolvedBorderColor;
|
|
47
|
+
}
|
|
48
|
+
if (disabled) {
|
|
49
|
+
containerStyle.opacity = 0.5;
|
|
50
|
+
}
|
|
51
|
+
const paddingValue = tokens.spacing[sizeConfig.paddingKey];
|
|
52
|
+
const chipsRowStyle = {
|
|
53
|
+
flexDirection: 'row',
|
|
54
|
+
flexWrap: 'wrap',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
gap: tokens.spacing.xs,
|
|
57
|
+
padding: paddingValue,
|
|
58
|
+
};
|
|
59
|
+
const inputStyle = {
|
|
60
|
+
fontSize: sizeConfig.fontSize,
|
|
61
|
+
fontFamily: tokens.typography.fontFamily.body,
|
|
62
|
+
fontWeight: tokens.typography.weights.regular,
|
|
63
|
+
color: tokens.colors.foreground,
|
|
64
|
+
flex: 1,
|
|
65
|
+
minWidth: 80,
|
|
66
|
+
paddingHorizontal: 0,
|
|
67
|
+
paddingVertical: 0,
|
|
68
|
+
};
|
|
69
|
+
const labelStyle = {
|
|
70
|
+
fontSize: tokens.typography.sizes.sm,
|
|
71
|
+
fontFamily: tokens.typography.fontFamily.body,
|
|
72
|
+
fontWeight: tokens.typography.weights.medium,
|
|
73
|
+
color: tokens.colors.foreground,
|
|
74
|
+
};
|
|
75
|
+
const errorTextStyle = {
|
|
76
|
+
fontSize: tokens.typography.sizes.xs,
|
|
77
|
+
fontFamily: tokens.typography.fontFamily.body,
|
|
78
|
+
fontWeight: tokens.typography.weights.regular,
|
|
79
|
+
color: tokens.colors.destructive,
|
|
80
|
+
};
|
|
81
|
+
const hintTextStyle = {
|
|
82
|
+
fontSize: tokens.typography.sizes.xs,
|
|
83
|
+
fontFamily: tokens.typography.fontFamily.body,
|
|
84
|
+
fontWeight: tokens.typography.weights.regular,
|
|
85
|
+
color: tokens.colors.mutedForeground,
|
|
86
|
+
};
|
|
87
|
+
const accessibilityState = {};
|
|
88
|
+
if (disabled)
|
|
89
|
+
accessibilityState.disabled = true;
|
|
90
|
+
return {
|
|
91
|
+
containerStyle,
|
|
92
|
+
chipsRowStyle,
|
|
93
|
+
inputStyle,
|
|
94
|
+
labelStyle,
|
|
95
|
+
errorTextStyle,
|
|
96
|
+
hintTextStyle,
|
|
97
|
+
isFull,
|
|
98
|
+
isDisabled: disabled,
|
|
99
|
+
accessibilityProps: {
|
|
100
|
+
...(Object.keys(accessibilityState).length > 0 && { accessibilityState }),
|
|
101
|
+
...(accessibilityLabel !== undefined && { accessibilityLabel }),
|
|
102
|
+
...(testID !== undefined && { testID }),
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=use-chip-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-chip-input.js","sourceRoot":"","sources":["../../../../src/components/inputs/chip-input/use-chip-input.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAiD,MAAM,8BAA8B,CAAC;AAQ9G,MAAM,QAAQ,GAAsC;IAClD,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;IACrD,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;IACrD,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;CACtD,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,MAAmB,EAAE,KAAyB;IACzE,MAAM,EACJ,MAAM,EACN,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,IAAI,GAAG,IAAI,EACX,OAAO,GAAG,SAAS,EACnB,KAAK,EACL,kBAAkB,EAClB,MAAM,EACN,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAC7B,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EACzB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAClC,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EACvC,QAAQ,EAAE,QAAQ,E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KAAK,SAAS,IAAI,EAAE,kBAAkB,EAAE,CAAC;YAC/D,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,EAAE,MAAM,EAAE,CAAC;SACxC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -20,4 +20,12 @@ export { SegmentedControl, useSegmentedControl } from './segmented-control/index
|
|
|
20
20
|
export type { SegmentedControlProps, Segment, UseSegmentedControlResult } from './segmented-control/index.js';
|
|
21
21
|
export { DatePicker, useDatePicker } from './date-picker/index.js';
|
|
22
22
|
export type { DatePickerProps, DatePickerHookProps, DatePickerMode, UseDatePickerResult } from './date-picker/index.js';
|
|
23
|
+
export { Chip, useChip } from './chip/index.js';
|
|
24
|
+
export type { ChipProps, ChipSize, ChipVariant, UseChipResult } from './chip/index.js';
|
|
25
|
+
export { QuantityPicker, useQuantityPicker } from './quantity-picker/index.js';
|
|
26
|
+
export type { QuantityPickerProps, UseQuantityPickerResult } from './quantity-picker/index.js';
|
|
27
|
+
export { ChipInput, useChipInput } from './chip-input/index.js';
|
|
28
|
+
export type { ChipInputProps, ChipInputHookProps, ChipInputVariant, ChipInputSize, UseChipInputResult } from './chip-input/index.js';
|
|
29
|
+
export { Autocomplete, useAutocomplete } from './autocomplete/index.js';
|
|
30
|
+
export type { AutocompleteProps, AutocompleteHookProps, AutocompleteOption, AutocompleteVariant, AutocompleteSize, UseAutocompleteResult } from './autocomplete/index.js';
|
|
23
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/inputs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAChE,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEtH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAChE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AY,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAErI,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -9,4 +9,8 @@ export { OTPInput, useOTPInput } from './otp-input/index.js';
|
|
|
9
9
|
export { PhoneInput, usePhoneInput, allCountries, popularCountries } from './phone-input/index.js';
|
|
10
10
|
export { SegmentedControl, useSegmentedControl } from './segmented-control/index.js';
|
|
11
11
|
export { DatePicker, useDatePicker } from './date-picker/index.js';
|
|
12
|
+
export { Chip, useChip } from './chip/index.js';
|
|
13
|
+
export { QuantityPicker, useQuantityPicker } from './quantity-picker/index.js';
|
|
14
|
+
export { ChipInput, useChipInput } from './chip-input/index.js';
|
|
15
|
+
export { Autocomplete, useAutocomplete } from './autocomplete/index.js';
|
|
12
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/inputs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGhH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,YAA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,EAAE,MAAM,wBAAwB,CAAC;AAGnE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/quantity-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/inputs/quantity-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { View, type ViewProps } from 'react-native';
|
|
2
|
+
import type { QuantityPickerProps } from './types.js';
|
|
3
|
+
export declare const QuantityPicker: import("react").ForwardRefExoticComponent<QuantityPickerProps & Omit<ViewProps, keyof QuantityPickerProps> & import("react").RefAttributes<View>>;
|
|
4
|
+
//# sourceMappingURL=quantity-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quantity-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/quantity-picker/quantity-picker.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAA6B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAG/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,eAAO,MAAM,cAAc,mJAsFzB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { forwardRef, createElement } from 'react';
|
|
2
|
+
import { View, Pressable, Text as RNText } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../../theme/context.js';
|
|
4
|
+
import { useQuantityPicker } from './use-quantity-picker.js';
|
|
5
|
+
export const QuantityPicker = forwardRef(function QuantityPicker(props, ref) {
|
|
6
|
+
const { tokens } = useTheme();
|
|
7
|
+
const { value, onValueChange, min = 0, max = 99, step = 1, disabled = false, haptic: _haptic, formatValue: _formatValue, size: _size, bg, p, px, py, pt, pb, pl, pr, m, mx, my, mt, mb, ml, mr, rounded, shadow, flex, row, center, w, h, borderWidth, borderColor, opacity, overflow, position, top, bottom, left, right, zIndex, accessibilityLabel: _accessibilityLabel, testID: _testID, children: _children, ...rest } = props;
|
|
8
|
+
const { containerStyle, decrementButtonStyle, incrementButtonStyle, valueContainerStyle, valueTextStyle, decrementIconColor, incrementIconColor, formattedValue, accessibilityProps, } = useQuantityPicker(tokens, props);
|
|
9
|
+
const handleDecrement = () => {
|
|
10
|
+
if (!disabled) {
|
|
11
|
+
onValueChange(Math.max(min, value - step));
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
const handleIncrement = () => {
|
|
15
|
+
if (!disabled) {
|
|
16
|
+
onValueChange(Math.min(max, value + step));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const decrementButton = createElement(Pressable, {
|
|
20
|
+
key: 'decrement',
|
|
21
|
+
style: decrementButtonStyle,
|
|
22
|
+
onPress: handleDecrement,
|
|
23
|
+
disabled,
|
|
24
|
+
accessibilityRole: 'button',
|
|
25
|
+
accessibilityLabel: 'Decrease',
|
|
26
|
+
}, createElement(RNText, { style: { color: decrementIconColor, fontSize: 18, lineHeight: 20 } }, '−'));
|
|
27
|
+
const valueDisplay = createElement(View, { key: 'value', style: valueContainerStyle }, createElement(RNText, { style: valueTextStyle }, formattedValue));
|
|
28
|
+
const incrementButton = createElement(Pressable, {
|
|
29
|
+
key: 'increment',
|
|
30
|
+
style: incrementButtonStyle,
|
|
31
|
+
onPress: handleIncrement,
|
|
32
|
+
disabled,
|
|
33
|
+
accessibilityRole: 'button',
|
|
34
|
+
accessibilityLabel: 'Increase',
|
|
35
|
+
}, createElement(RNText, { style: { color: incrementIconColor, fontSize: 18, lineHeight: 20 } }, '+'));
|
|
36
|
+
return createElement(View, {
|
|
37
|
+
ref,
|
|
38
|
+
style: containerStyle,
|
|
39
|
+
...accessibilityProps,
|
|
40
|
+
...rest,
|
|
41
|
+
}, decrementButton, valueDisplay, incrementButton);
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=quantity-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quantity-picker.js","sourceRoot":"","sources":["../../../../src/components/inputs/quantity-picker/quantity-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,IAAI,MAAM,EAAkB,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,cAAc,CAC9D,KAAuE,EACvE,GAAc;IAEd,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC9B,MAAM,EACJ,KAAK,EAAE,aAAa,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,EAAE,EAAE,IAAI,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,EACnE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,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QACR,iBAAiB,EAAE,QAAiB;QACpC,kBAAkB,EAAE,UAAU;KAC/B,EACD,aAAa,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CACnG,CAAC;IAEF,MAAM,YAAY,GAAG,aAAa,CAChC,IAAI,EACJ,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC5C,aAAa,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,cAAc,CAAC,CACjE,CAAC;IAEF,MAAM,eAAe,GAAG,aAAa,CACnC,SAAgB,EAChB;QACE,GAAG,EAAE,WAAW;QAChB,KAAK,EAAE,oBAAoB;QAC3B,OAAO,EAAE,eAAe;QACxB,QAAQ;QACR,iBAAiB,EAAE,QAAiB;QACpC,kBAAkB,EAAE,UAAU;KAC/B,EACD,aAAa,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CACnG,CAAC;IAEF,OAAO,aAAa,CAClB,IAAW,EACX;QACE,GAAG;QACH,KAAK,EAAE,cAAc;QACrB,GAAG,kBAAkB;QACrB,GAAG,IAAI;KACR,EACD,eAAe,EACf,YAAY,EACZ,eAAe,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { BoxStyleProps, SizeVariant } from '../../types.js';
|
|
2
|
+
import type { ResolvedBoxStyle, ResolvedTextStyle } from '../../use-component-style.js';
|
|
3
|
+
export interface QuantityPickerProps extends BoxStyleProps {
|
|
4
|
+
value: number;
|
|
5
|
+
onValueChange: (value: number) => void;
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
size?: SizeVariant;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
haptic?: boolean;
|
|
12
|
+
formatValue?: (value: number) => string;
|
|
13
|
+
accessibilityLabel?: string;
|
|
14
|
+
testID?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface UseQuantityPickerResult {
|
|
17
|
+
containerStyle: ResolvedBoxStyle;
|
|
18
|
+
decrementButtonStyle: ResolvedBoxStyle;
|
|
19
|
+
incrementButtonStyle: ResolvedBoxStyle;
|
|
20
|
+
valueContainerStyle: ResolvedBoxStyle;
|
|
21
|
+
valueTextStyle: ResolvedTextStyle;
|
|
22
|
+
decrementIconColor: string;
|
|
23
|
+
incrementIconColor: string;
|
|
24
|
+
buttonIconSize: number;
|
|
25
|
+
canDecrement: boolean;
|
|
26
|
+
canIncrement: boolean;
|
|
27
|
+
formattedValue: string;
|
|
28
|
+
accessibilityProps: {
|
|
29
|
+
accessibilityLabel: string;
|
|
30
|
+
accessibilityValue: {
|
|
31
|
+
min: number;
|
|
32
|
+
max: number;
|
|
33
|
+
now: number;
|
|
34
|
+
text: string;
|
|
35
|
+
};
|
|
36
|
+
testID?: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/quantity-picker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAExF,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,gBAAgB,CAAC;IACjC,oBAAoB,EAAE,gBAAgB,CAAC;IACvC,oBAAoB,EAAE,gBAAgB,CAAC;IACvC,mBAAmB,EAAE,gBAAgB,CAAC;IACtC,cAAc,EAAE,iBAAiB,CAAC;IAClC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE;QAClB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,kBAAkB,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/inputs/quantity-picker/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ThemeTokens } from '../../../theme/tokens.js';
|
|
2
|
+
import type { QuantityPickerProps, UseQuantityPickerResult } from './types.js';
|
|
3
|
+
export declare function useQuantityPicker(tokens: ThemeTokens, props: QuantityPickerProps): UseQuantityPickerResult;
|
|
4
|
+
//# sourceMappingURL=use-quantity-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-quantity-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/quantity-picker/use-quantity-picker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAkB/E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,mBAAmB,GAAG,uBAAuB,CAqF1G"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const SIZE_MAP = {
|
|
2
|
+
xs: { buttonDiameter: 24, iconSize: 12, fontSize: 12 },
|
|
3
|
+
sm: { buttonDiameter: 28, iconSize: 14, fontSize: 14 },
|
|
4
|
+
md: { buttonDiameter: 34, iconSize: 16, fontSize: 16 },
|
|
5
|
+
lg: { buttonDiameter: 40, iconSize: 20, fontSize: 18 },
|
|
6
|
+
xl: { buttonDiameter: 48, iconSize: 24, fontSize: 20 },
|
|
7
|
+
};
|
|
8
|
+
export function useQuantityPicker(tokens, props) {
|
|
9
|
+
const { value, min = 0, max = 99, size = 'md', disabled = false, formatValue, accessibilityLabel, testID, } = props;
|
|
10
|
+
const sizeConfig = SIZE_MAP[size];
|
|
11
|
+
const canDecrement = value > min;
|
|
12
|
+
const canIncrement = value < max;
|
|
13
|
+
const containerStyle = {
|
|
14
|
+
flexDirection: 'row',
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
gap: tokens.spacing.sm,
|
|
17
|
+
...(disabled && { opacity: 0.5 }),
|
|
18
|
+
};
|
|
19
|
+
const decrementActive = canDecrement && !disabled;
|
|
20
|
+
const incrementActive = canIncrement && !disabled;
|
|
21
|
+
const decrementButtonStyle = {
|
|
22
|
+
width: sizeConfig.buttonDiameter,
|
|
23
|
+
height: sizeConfig.buttonDiameter,
|
|
24
|
+
borderRadius: tokens.radii.full,
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
backgroundColor: decrementActive ? tokens.colors.primary : tokens.colors.muted,
|
|
28
|
+
};
|
|
29
|
+
const incrementButtonStyle = {
|
|
30
|
+
width: sizeConfig.buttonDiameter,
|
|
31
|
+
height: sizeConfig.buttonDiameter,
|
|
32
|
+
borderRadius: tokens.radii.full,
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
backgroundColor: incrementActive ? tokens.colors.primary : tokens.colors.muted,
|
|
36
|
+
};
|
|
37
|
+
const valueContainerStyle = {
|
|
38
|
+
minWidth: sizeConfig.buttonDiameter + 8,
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
justifyContent: 'center',
|
|
41
|
+
};
|
|
42
|
+
const valueTextStyle = {
|
|
43
|
+
fontSize: sizeConfig.fontSize,
|
|
44
|
+
fontFamily: tokens.typography.fontFamily.body,
|
|
45
|
+
fontWeight: tokens.typography.weights.semibold,
|
|
46
|
+
color: tokens.colors.foreground,
|
|
47
|
+
textAlign: 'center',
|
|
48
|
+
};
|
|
49
|
+
const decrementIconColor = decrementActive ? tokens.colors.primaryForeground : tokens.colors.mutedForeground;
|
|
50
|
+
const incrementIconColor = incrementActive ? tokens.colors.primaryForeground : tokens.colors.mutedForeground;
|
|
51
|
+
const formattedValue = formatValue ? formatValue(value) : String(value);
|
|
52
|
+
const label = accessibilityLabel ?? 'Quantity';
|
|
53
|
+
const text = `${label}: ${formattedValue}`;
|
|
54
|
+
return {
|
|
55
|
+
containerStyle,
|
|
56
|
+
decrementButtonStyle,
|
|
57
|
+
incrementButtonStyle,
|
|
58
|
+
valueContainerStyle,
|
|
59
|
+
valueTextStyle,
|
|
60
|
+
decrementIconColor,
|
|
61
|
+
incrementIconColor,
|
|
62
|
+
buttonIconSize: sizeConfig.iconSize,
|
|
63
|
+
canDecrement,
|
|
64
|
+
canIncrement,
|
|
65
|
+
formattedValue,
|
|
66
|
+
accessibilityProps: {
|
|
67
|
+
accessibilityLabel: label,
|
|
68
|
+
accessibilityValue: { min, max, now: value, text },
|
|
69
|
+
...(testID !== undefined && { testID }),
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=use-quantity-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-quantity-picker.js","sourceRoot":"","sources":["../../../../src/components/inputs/quantity-picker/use-quantity-picker.ts"],"names":[],"mappings":"AAWA,MAAM,QAAQ,GAAkD;IAC9D,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtD,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtD,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtD,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtD,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;CACvD,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAAC,MAAmB,EAAE,KAA0B;IAC/E,MAAM,EACJ,KAAK,EACL,GAAG,GAAG,CAAC,EACP,GAAG,GAAG,EAAE,EACR,IAAI,GAAG,IAAI,EACX,QAAQ,GAAG,KAAK,EAChB,WAAW,EACX,kBAAkB,EAClB,MAAM,GACP,GAAG,KAAK,CAAC;IAEV,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAElC,MAAM,YAAY,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ources":["../../../src/components/interactive/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/interactive/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/interactive/swipeable-row/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/interactive/swipeable-row/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createElement, type ReactElement } from 'react';
|
|
2
|
+
import type { SwipeableRowProps } from './types.js';
|
|
3
|
+
interface SwipeableRowShellProps extends SwipeableRowProps {
|
|
4
|
+
children: ReactElement;
|
|
5
|
+
}
|
|
6
|
+
export declare function SwipeableRow(props: SwipeableRowShellProps): ReturnType<typeof createElement>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=swipeable-row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swipeable-row.d.ts","sourceRoot":"","sources":["../../../../src/components/interactive/swipeable-row/swipeable-row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAIzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,UAAU,sBAAuB,SAAQ,iBAAiB;IACxD,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,sBAAsB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAqC5F"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import { View, Text } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../../theme/context.js';
|
|
4
|
+
import { useSwipeableRow } from './use-swipeable-row.js';
|
|
5
|
+
export function SwipeableRow(props) {
|
|
6
|
+
const { tokens } = useTheme();
|
|
7
|
+
const { children, leftActions = [], rightActions = [] } = props;
|
|
8
|
+
const { rowStyle, leftActionsContainerStyle, rightActionsContainerStyle, actionStyle, actionLabelStyle, accessibilityProps, } = useSwipeableRow(tokens, props);
|
|
9
|
+
const renderActions = (actions, containerStyle) => actions.length > 0
|
|
10
|
+
? createElement(View, { style: containerStyle }, ...actions.map((action, index) => createElement(View, { key: action.key, style: actionStyle(action, index) }, action.label !== undefined
|
|
11
|
+
? createElement(Text, { style: actionLabelStyle }, action.label)
|
|
12
|
+
: null)))
|
|
13
|
+
: null;
|
|
14
|
+
return createElement(View, { style: rowStyle, ...accessibilityProps }, renderActions(leftActions, leftActionsContainerStyle), children, renderActions(rightActions, rightActionsContainerStyle));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=swipeable-row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swipeable-row.js","sourceRoot":"","sources":["../../../../src/components/interactive/swipeable-row/swipeable-row.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAqB,MAAM,O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,QAAQ,EACR,aAAa,CAAC,YAAY,EAAE,0BAA0B,CAAC,CACxD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ResolvedBoxStyle, ResolvedTextStyle } from '../../use-component-style.js';
|
|
2
|
+
export interface SwipeAction {
|
|
3
|
+
key: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
textColor?: string;
|
|
8
|
+
onPress: () => void;
|
|
9
|
+
autoTrigger?: boolean;
|
|
10
|
+
width?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface SwipeableRowProps {
|
|
13
|
+
leftActions?: SwipeAction[];
|
|
14
|
+
rightActions?: SwipeAction[];
|
|
15
|
+
enabled?: boolean;
|
|
16
|
+
friction?: number;
|
|
17
|
+
overshootFriction?: number;
|
|
18
|
+
onSwipeLeft?: () => void;
|
|
19
|
+
onSwipeRight?: () => void;
|
|
20
|
+
accessibilityLabel?: string;
|
|
21
|
+
testID?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface UseSwipeableRowResult {
|
|
24
|
+
rowStyle: ResolvedBoxStyle;
|
|
25
|
+
leftActionsContainerStyle: ResolvedBoxStyle;
|
|
26
|
+
rightActionsContainerStyle: ResolvedBoxStyle;
|
|
27
|
+
actionStyle: (action: SwipeAction, index: number) => ResolvedBoxStyle;
|
|
28
|
+
actionLabelStyle: ResolvedTextStyle;
|
|
29
|
+
actionIconColor: string;
|
|
30
|
+
totalLeftWidth: number;
|
|
31
|
+
totalRightWidth: number;
|
|
32
|
+
accessibilityProps: {
|
|
33
|
+
accessibilityLabel?: string;
|
|
34
|
+
testID?: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/interactive/swipeable-row/types.ts"],"names":[],"mappings":"AAAA,OAAO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 -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/interactive/swipeable-row/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ThemeTokens } from '../../../theme/tokens.js';
|
|
2
|
+
import type { SwipeableRowProps, UseSwipeableRowResult } from './types.js';
|
|
3
|
+
export declare function useSwipeableRow(tokens: ThemeTokens, props: SwipeableRowProps): UseSwipeableRowResult;
|
|
4
|
+
//# sourceMappingURL=use-swipeable-row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-swipeable-row.d.ts","sourceRoot":"","sources":["../../../../src/components/interactive/swipeable-row/use-swipeable-row.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAe,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAMxF,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,iBAAiB,GAAG,qBAAqB,CAoEpG"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const DEFAULT_ACTION_WIDTH = 80;
|
|
2
|
+
const WHITE = '#ffffff';
|
|
3
|
+
export function useSwipeableRow(tokens, props) {
|
|
4
|
+
const { leftActions = [], rightActions = [], accessibilityLabel, testID, } = props;
|
|
5
|
+
const totalLeftWidth = leftActions.reduce((sum, action) => sum + (action.width ?? DEFAULT_ACTION_WIDTH), 0);
|
|
6
|
+
const totalRightWidth = rightActions.reduce((sum, action) => sum + (action.width ?? DEFAULT_ACTION_WIDTH), 0);
|
|
7
|
+
const rowStyle = {
|
|
8
|
+
overflow: 'hidden',
|
|
9
|
+
backgroundColor: tokens.colors.card,
|
|
10
|
+
};
|
|
11
|
+
const leftActionsContainerStyle = {
|
|
12
|
+
flexDirection: 'row',
|
|
13
|
+
height: '100%',
|
|
14
|
+
position: 'absolute',
|
|
15
|
+
left: 0,
|
|
16
|
+
};
|
|
17
|
+
const rightActionsContainerStyle = {
|
|
18
|
+
flexDirection: 'row',
|
|
19
|
+
height: '100%',
|
|
20
|
+
position: 'absolute',
|
|
21
|
+
right: 0,
|
|
22
|
+
};
|
|
23
|
+
const actionStyle = (action, _index) => ({
|
|
24
|
+
width: action.width ?? DEFAULT_ACTION_WIDTH,
|
|
25
|
+
backgroundColor: action.color ?? tokens.colors.primary,
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
justifyContent: 'center',
|
|
28
|
+
height: '100%',
|
|
29
|
+
});
|
|
30
|
+
const actionLabelStyle = {
|
|
31
|
+
fontSize: tokens.typography.sizes.sm,
|
|
32
|
+
fontWeight: tokens.typography.weights.bold,
|
|
33
|
+
color: WHITE,
|
|
34
|
+
fontFamily: tokens.typography.fontFamily.body,
|
|
35
|
+
};
|
|
36
|
+
const actionIconColor = WHITE;
|
|
37
|
+
return {
|
|
38
|
+
rowStyle,
|
|
39
|
+
leftActionsContainerStyle,
|
|
40
|
+
rightActionsContainerStyle,
|
|
41
|
+
actionStyle,
|
|
42
|
+
actionLabelStyle,
|
|
43
|
+
actionIconColor,
|
|
44
|
+
totalLeftWidth,
|
|
45
|
+
totalRightWidth,
|
|
46
|
+
accessibilityProps: {
|
|
47
|
+
...(accessibilityLabel !== undefined && { accessibilityLabel }),
|
|
48
|
+
...(testID !== undefined && { testID }),
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=use-swipeable-row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-swipeable-row.js","sourceRoot":"","sources":["../../../../src/components/interactive/swipeable-row/use-swipeable-row.ts"],"names":[],"mappings":"AAIA,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,KAAK,GAAG,SAAS,CAAC;AAExB,MAAM,UAAU,eAAe,CAAC,MAAmB,EAAE,KAAwB;IAC3E,MAAM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C,UAAU,CAAC,OAAO,CAAC,IAAI;QAC1C,KAAK,EAAE,KAAK;QACZ,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI;KAC9C,CAAC;IAEF,MAAM,eAAe,GAAG,KAAK,CAAC;IAE9B,OAAO;QACL,QAAQ;QACR,yBAAyB;QACzB,0BAA0B;QAC1B,WAAW;QACX,gBAAgB;QAChB,eAAe;QACf,cAAc;QACd,eAAe;QACf,kBAAkB,EAAE;YAClB,GAAG,CAAC,kBAAkB,KAAK,SAAS,IAAI,EAAE,kBAAkB,EAAE,CAAC;YAC/D,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,EAAE,MAAM,EAAE,CAAC;SACxC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { View, type ViewProps } from 'react-native';
|
|
2
|
+
import type { CollapsibleHeaderProps } from './types.js';
|
|
3
|
+
export declare const CollapsibleHeader: import("react").ForwardRefExoticComponent<CollapsibleHeaderProps & Omit<ViewProps, keyof CollapsibleHeaderProps> & import("react").RefAttributes<View>>;
|
|
4
|
+
//# sourceMappingURL=collapsible-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible-header.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/collapsible-header/collapsible-header.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAG1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,eAAO,MAAM,iBAAiB,yJAiD5B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { forwardRef, createElement } from 'react';
|
|
2
|
+
import { View, Text } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../../theme/context.js';
|
|
4
|
+
import { useCollapsibleHeader } from './use-collapsible-header.js';
|
|
5
|
+
export const CollapsibleHeader = forwardRef(function CollapsibleHeader(props, ref) {
|
|
6
|
+
const { tokens } = useTheme();
|
|
7
|
+
const { largeTitle, compactTitle, subtitle, bg: _bg, p: _p, px: _px, py: _py, pt: _pt, pb: _pb, pl: _pl, pr: _pr, m: _m, mx: _mx, my: _my, mt: _mt, mb: _mb, ml: _ml, mr: _mr, rounded: _rounded, shadow: _shadow, flex: _flex, row: _row, center: _center, w: _w, h: _h, borderWidth: _bw, borderColor: _bc, opacity: _op, overflow: _ov, position: _pos, top: _top, bottom: _bot, left: _left, right: _right, zIndex: _zi, ...rest } = props;
|
|
8
|
+
const { containerStyle, largeTitleStyle, compactTitleStyle, subtitleStyle, borderStyle, largeTitleOpacity, compactTitleOpacity, accessibilityProps, } = useCollapsibleHeader(tokens, props);
|
|
9
|
+
const resolvedCompactTitle = compactTitle ?? largeTitle;
|
|
10
|
+
return createElement(View, { ref, style: containerStyle, ...accessibilityProps, ...rest }, createElement(View, { style: { opacity: compactTitleOpacity } }, createElement(Text, { style: compactTitleStyle }, resolvedCompactTitle)), createElement(View, { style: { opacity: largeTitleOpacity } }, createElement(Text, { style: largeTitleStyle }, largeTitle), subtitle !== undefined
|
|
11
|
+
? createElement(Text, { style: subtitleStyle }, subtitle)
|
|
12
|
+
: null), createElement(View, { style: borderStyle }));
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=collapsible-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible-header.js","sourceRoot":"","sources":["../../../../src/components/navigation/collapsible-header/collapsible-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,MAAM,CAAC,MAAM,iBAAiB,G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