@anker-in/headless-ui 1.3.57 → 1.3.59
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/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.d.ts +11 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.d.ts +23 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.d.ts +40 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.d.ts +107 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.d.ts +82 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.d.ts +22 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.d.ts +10 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.d.ts +9 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/index.d.ts +9 -0
- package/dist/cjs/biz-components/AccessoriesShelf/index.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/index.js.map +7 -0
- package/dist/cjs/biz-components/AccessoriesShelf/types.d.ts +16 -0
- package/dist/cjs/biz-components/AccessoriesShelf/types.js +2 -0
- package/dist/cjs/biz-components/AccessoriesShelf/types.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.d.ts +15 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.d.ts +11 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.d.ts +14 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.d.ts +56 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.d.ts +4 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.d.ts +10 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.d.ts +11 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.d.ts +13 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.d.ts +4 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.d.ts +11 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.d.ts +8 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartItemRow/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.d.ts +34 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.d.ts +51 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.d.ts +26 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.d.ts +10 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.d.ts +2 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/index.d.ts +16 -0
- package/dist/cjs/biz-components/CartDetail/index.js +2 -0
- package/dist/cjs/biz-components/CartDetail/index.js.map +7 -0
- package/dist/cjs/biz-components/CartDetail/types.d.ts +132 -0
- package/dist/cjs/biz-components/CartDetail/types.js +2 -0
- package/dist/cjs/biz-components/CartDetail/types.js.map +7 -0
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +2 -2
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
- package/dist/cjs/biz-components/index.d.ts +6 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/breadcrumb.d.ts +12 -0
- package/dist/cjs/components/breadcrumb.js +2 -0
- package/dist/cjs/components/breadcrumb.js.map +7 -0
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +2 -2
- package/dist/cjs/components/index.d.ts +3 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/input-number.d.ts +22 -0
- package/dist/cjs/components/input-number.js +1 -1
- package/dist/cjs/components/input-number.js.map +3 -3
- package/dist/cjs/components/input.d.ts +5 -0
- package/dist/cjs/components/input.js +1 -1
- package/dist/cjs/components/input.js.map +3 -3
- package/dist/cjs/components/popover.d.ts +17 -2
- package/dist/cjs/components/popover.js +1 -1
- package/dist/cjs/components/popover.js.map +3 -3
- package/dist/cjs/components/toast.d.ts +25 -0
- package/dist/cjs/components/toast.js +2 -0
- package/dist/cjs/components/toast.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.d.ts +11 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.d.ts +23 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.d.ts +40 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.d.ts +107 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js +1 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.d.ts +82 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/AddToCartSuccessPopover/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.d.ts +22 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.d.ts +10 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.d.ts +9 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/index.d.ts +9 -0
- package/dist/esm/biz-components/AccessoriesShelf/index.js +2 -0
- package/dist/esm/biz-components/AccessoriesShelf/index.js.map +7 -0
- package/dist/esm/biz-components/AccessoriesShelf/types.d.ts +16 -0
- package/dist/esm/biz-components/AccessoriesShelf/types.js +1 -0
- package/dist/esm/biz-components/AccessoriesShelf/types.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.d.ts +15 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.d.ts +11 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.d.ts +14 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartGiftSection/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.d.ts +56 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.d.ts +4 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.d.ts +10 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js +1 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.d.ts +11 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.d.ts +13 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.d.ts +4 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.d.ts +11 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js +1 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.d.ts +8 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartItemRow/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.d.ts +34 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartPerksSection/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.d.ts +51 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.d.ts +26 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.d.ts +10 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/index.d.ts +2 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/CartThirdParty/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/index.d.ts +16 -0
- package/dist/esm/biz-components/CartDetail/index.js +2 -0
- package/dist/esm/biz-components/CartDetail/index.js.map +7 -0
- package/dist/esm/biz-components/CartDetail/types.d.ts +132 -0
- package/dist/esm/biz-components/CartDetail/types.js +1 -0
- package/dist/esm/biz-components/CartDetail/types.js.map +7 -0
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
- package/dist/esm/biz-components/index.d.ts +6 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/breadcrumb.d.ts +12 -0
- package/dist/esm/components/breadcrumb.js +2 -0
- package/dist/esm/components/breadcrumb.js.map +7 -0
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +2 -2
- package/dist/esm/components/index.d.ts +3 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +3 -3
- package/dist/esm/components/input-number.d.ts +22 -0
- package/dist/esm/components/input-number.js +1 -1
- package/dist/esm/components/input-number.js.map +3 -3
- package/dist/esm/components/input.d.ts +5 -0
- package/dist/esm/components/input.js +1 -1
- package/dist/esm/components/input.js.map +3 -3
- package/dist/esm/components/popover.d.ts +17 -2
- package/dist/esm/components/popover.js +1 -1
- package/dist/esm/components/popover.js.map +3 -3
- package/dist/esm/components/toast.d.ts +25 -0
- package/dist/esm/components/toast.js +2 -0
- package/dist/esm/components/toast.js.map +7 -0
- package/dist/tokens/base.css +4 -0
- package/package.json +1 -1
- package/style.css +270 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/button.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport Spinner from '../icons/spinner.js'\nimport { cn } from '../helpers/index.js'\n\nexport const sizeMap = {\n sm: {\n width: '16',\n height: '16',\n },\n base: {\n width: '18',\n height: '18',\n },\n lg: {\n width: '20',\n height: '20',\n },\n}\nconst LinkButtonAppendIcon = ({ size = 'base', ...rest }: { size: 'base' | 'lg' | 'sm'; className?: string }) => {\n const { width, height } = sizeMap[size]\n return (\n <svg width={width} height={height} viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...rest}>\n <path\n d=\"M7.5 5L12.5 10L7.5 15\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\n/**\n * Button Variants\n */\n// eslint-disable-next-line tailwindcss/enforces-negative-arbitrary-values\nconst buttonVariants = cva(\n 'rounded-btn inline-flex cursor-pointer items-center justify-center text-sm font-bold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none',\n {\n variants: {\n variant: {\n primary:\n 'bg-btn-primary text-btn-primary-foreground hover:bg-btn-primary-active hover:text-btn-primary-active-foreground hover:bg-gradient-brand border-none ',\n secondary:\n 'bg-btn-secondary outline-btn-primary text-btn-secondary-foreground hover:bg-btn-secondary-active hover:text-btn-secondary-active-foreground border-solid outline outline-[1.6px] outline-offset-[-1.6px]',\n link: 'text-info-primary hover:text-btn-primary-active border-none',\n ghost: 'text-info-primary hover:bg-btn-primary hover:text-btn-primary-foreground',\n },\n size: {\n sm: 'px-3 py-2 text-[12px] leading-tight',\n base: 'px-5 pb-[10px] pt-[11px] text-[14px] leading-tight',\n lg: 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight',\n icon: 'size-10 rounded-full leading-tight',\n },\n /** hover \u72B6\u6001\u4E0B\u7684\u52A8\u753B\u6548\u679C,\u9700\u8981\u6CE8\u610F\u4E0D\u540Cvariant \u4E0B\u7684\u6548\u679C */\n hoverEffect: {\n none: '',\n slide: '',\n },\n state: {\n default: '',\n disabled: '',\n loading: '',\n },\n },\n compoundVariants: [\n {\n variant: 'primary',\n hoverEffect: 'slide',\n class:\n 'before:rounded-btn hover:!bg-btn-primary before:bg-btn-primary-active relative z-[1] overflow-hidden before:absolute before:inset-y-0 before:-z-[1] before:w-full before:-translate-x-full before:transition-transform before:duration-300 before:ease-in-out before:content-[\"\"] hover:before:translate-x-0',\n },\n {\n variant: 'secondary',\n hoverEffect: 'slide',\n class:\n 'before:rounded-btn hover:!bg-btn-secondary before:bg-btn-secondary-active relative z-[1] overflow-hidden before:absolute before:inset-y-0 before:-z-[1] before:w-full before:-translate-x-full before:transition-transform before:duration-300 before:ease-in-out before:content-[\"\"] hover:before:translate-x-0',\n },\n {\n variant: 'primary',\n state: 'loading',\n class: 'bg-btn-primary-active disabled:border-btn-primary-disabled-border',\n },\n {\n variant: 'secondary',\n state: 'loading',\n class:\n 'bg-btn-secondary disabled:bg-btn-secondary-disabled disabled:text-btn-secondary-disabled-foreground disabled:border-btn-primary-disabled',\n },\n {\n variant: 'primary',\n state: 'disabled',\n class:\n 'disabled:bg-btn-primary-disabled disabled:text-btn-primary-disabled-foreground disabled:border-btn-primary-disabled',\n },\n {\n variant: 'secondary',\n state: 'disabled',\n class:\n 'disabled:bg-btn-secondary-disabled disabled:text-btn-secondary-disabled-foreground disabled:border-btn-secondary-disabled-border disabled:outline-btn-secondary-disabled-border',\n },\n {\n variant: 'link',\n state: 'disabled',\n class: 'disabled:text-info-quaternary',\n },\n ],\n defaultVariants: {\n variant: 'primary',\n size: 'lg',\n hoverEffect: 'none',\n state: 'default',\n },\n }\n)\n\nconst loadingSvgVariants = cva('', {\n variants: {\n variant: {\n primary: 'stroke-btn-primary-foreground',\n secondary: 'stroke-btn-secondary-foreground',\n link: 'stroke-primary',\n ghost: 'stroke-primary',\n },\n },\n defaultVariants: {\n variant: 'primary',\n },\n})\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {\n /** \u8BBE\u7F6E\u6309\u94AE\u8F7D\u5165\u72B6\u6001 */\n loading?: boolean\n /** \u8BBE\u7F6E\u6309\u94AE\u5931\u6548\u72B6\u6001 */\n disabled?: boolean\n /** \u5B9A\u4E49\u81EA\u7EC4\u4EF6\u4F5C\u4E3A\u7236\u7EC4\u4EF6\u7684\u7C7B\u578B\uFF0C \u8BE6\u7EC6\u4F7F\u7528\u65B9\u5F0F\u8BF7\u53C2\u8003radix-ui (\u5DF2\u4F5C\u5E9F\u8BF7\u52FF\u4F7F\u7528) */\n asChild?: boolean\n /** \u5B9A\u4E49\u81EA\u7EC4\u4EF6\u4F5C\u4E3A\u7236\u7EC4\u4EF6\u7684\u7C7B\u578B\uFF0C \u8BE6\u7EC6\u4F7F\u7528\u65B9\u5F0F\u8BF7\u53C2\u8003radix-ui */\n as?: 'button' | 'a'\n href?: string\n /** \u94FE\u63A5\u76EE\u6807\uFF0C\u4EC5\u5728 as=\"a\" \u65F6\u751F\u6548\uFF0C\u5982 \"_blank\" \u53EF\u5728\u65B0\u7A97\u53E3\u6253\u5F00 */\n target?: React.AnchorHTMLAttributes<HTMLAnchorElement>['target']\n /** \u94FE\u63A5 rel \u5C5E\u6027\uFF0C\u4EC5\u5728 as=\"a\" \u65F6\u751F\u6548 */\n rel?: React.AnchorHTMLAttributes<HTMLAnchorElement>['rel']\n iconClassName?: string\n /** \u81EA\u5B9A\u4E49loading */\n spinner?: React.ReactNode\n}\n\n/**\n * Button - \u6309\u94AE\n *\n * @description \u53EF\u70B9\u51FB\u7684\u4EA4\u4E92\u5F0F\u6309\u94AE\u7EC4\u4EF6\uFF0C\u652F\u6301\u591A\u79CD\u6837\u5F0F\u3001\u5927\u5C0F\u3001\u72B6\u6001\u548C\u52A0\u8F7D\u6548\u679C\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n // eslint-disable-next-line\n asChild = false,\n as = 'button',\n href,\n target,\n rel,\n size = 'lg',\n children,\n variant,\n hoverEffect = 'none',\n className,\n disabled = false,\n loading = false,\n spinner,\n iconClassName,\n ...props\n }: ButtonProps,\n ref\n ) => {\n const Comp = as\n const isInactive = disabled || loading\n const state = loading ? 'loading' : disabled ? 'disabled' : 'default'\n\n return (\n <Comp\n disabled={isInactive}\n className={cn(buttonVariants({ variant, size, hoverEffect, state }), className)}\n ref={ref as any}\n {...(as === 'a' ? { href, target, rel } : {})}\n {...(props as any)}\n >\n {loading ? (\n <>\n <span style={{ display: 'contents', visibility: 'hidden' }} aria-hidden>\n {children}\n </span>\n <span className=\"absolute\">\n {spinner ? (\n spinner\n ) : (\n <Spinner\n className={loadingSvgVariants({\n variant,\n })}\n />\n )}\n </span>\n <VisuallyHidden>{children}</VisuallyHidden>\n </>\n ) : (\n <>\n {children}\n {variant === 'link' && size && size !== 'icon' && (\n <LinkButtonAppendIcon className={iconClassName} size={size} />\n )}\n </>\n )}\n </Comp>\n )\n }\n)\n\nButton.displayName = 'Button'\nexport default Button\n"],
|
|
5
|
-
"mappings": "aA0BM,OAyKI,YAAAA,EAzKJ,OAAAC,EAyKI,QAAAC,MAzKJ,oBAxBN,UAAYC,MAAW,QACvB,OAAS,kBAAAC,MAAsB,kCAC/B,OAA4B,OAAAC,MAAW,2BACvC,OAAOC,MAAa,sBACpB,OAAS,MAAAC,MAAU,sBAEZ,MAAMC,EAAU,CACrB,GAAI,CACF,MAAO,KACP,OAAQ,IACV,EACA,KAAM,CACJ,MAAO,KACP,OAAQ,IACV,EACA,GAAI,CACF,MAAO,KACP,OAAQ,IACV,CACF,EACMC,EAAuB,CAAC,CAAE,KAAAC,EAAO,OAAQ,GAAGC,CAAK,IAA0D,CAC/G,KAAM,CAAE,MAAAC,EAAO,OAAAC,CAAO,EAAIL,EAAQE,CAAI,EACtC,OACET,EAAC,OAAI,MAAOW,EAAO,OAAQC,EAAQ,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGF,EACxG,SAAAV,EAAC,QACC,EAAE,wBACF,OAAO,eACP,YAAY,UACZ,cAAc,QACd,eAAe,QACjB,EACF,CAEJ,EAMMa,EAAiBT,EACrB,gMACA,CACE,SAAU,CACR,QAAS,CACP,QACE,uJACF,UACE,2MACF,KAAM,8DACN,MAAO,0EACT,EACA,KAAM,CACJ,GAAI,sCACJ,KAAM,qDACN,GAAI,sIACJ,KAAM,oCACR,EAEA,YAAa,CACX,KAAM,GACN,MAAO,EACT,EACA,MAAO,CACL,QAAS,GACT,SAAU,GACV,QAAS,EACX,CACF,EACA,iBAAkB,CAChB,CACE,QAAS,UACT,YAAa,QACb,MACE,8SACJ,EACA,CACE,QAAS,YACT,YAAa,QACb,MACE,mTACJ,EACA,CACE,QAAS,UACT,MAAO,UACP,MAAO,mEACT,EACA,CACE,QAAS,YACT,MAAO,UACP,MACE,0IACJ,EACA,CACE,QAAS,UACT,MAAO,WACP,MACE,qHACJ,EACA,CACE,QAAS,YACT,MAAO,WACP,MACE,iLACJ,EACA,CACE,QAAS,OACT,MAAO,WACP,MAAO,+BACT,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,KACN,YAAa,OACb,MAAO,SACT,CACF,CACF,EAEMU,EAAqBV,EAAI,GAAI,CACjC,SAAU,CACR,QAAS,CACP,QAAS,gCACT,UAAW,kCACX,KAAM,
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport Spinner from '../icons/spinner.js'\nimport { cn } from '../helpers/index.js'\n\nexport const sizeMap = {\n sm: {\n width: '16',\n height: '16',\n },\n base: {\n width: '18',\n height: '18',\n },\n lg: {\n width: '20',\n height: '20',\n },\n}\nconst LinkButtonAppendIcon = ({ size = 'base', ...rest }: { size: 'base' | 'lg' | 'sm'; className?: string }) => {\n const { width, height } = sizeMap[size]\n return (\n <svg width={width} height={height} viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...rest}>\n <path\n d=\"M7.5 5L12.5 10L7.5 15\"\n stroke=\"currentColor\"\n strokeWidth=\"1.66667\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\n/**\n * Button Variants\n */\n// eslint-disable-next-line tailwindcss/enforces-negative-arbitrary-values\nconst buttonVariants = cva(\n 'rounded-btn inline-flex cursor-pointer items-center justify-center text-sm font-bold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none',\n {\n variants: {\n variant: {\n primary:\n 'bg-btn-primary text-btn-primary-foreground hover:bg-btn-primary-active hover:text-btn-primary-active-foreground hover:bg-gradient-brand border-none ',\n secondary:\n 'bg-btn-secondary outline-btn-primary text-btn-secondary-foreground hover:bg-btn-secondary-active hover:text-btn-secondary-active-foreground border-solid outline outline-[1.6px] outline-offset-[-1.6px]',\n link: 'text-info-primary hover:text-btn-primary-active border-none',\n ghost: 'text-info-primary hover:bg-btn-primary hover:text-btn-primary-foreground',\n },\n size: {\n sm: 'px-3 py-2 text-[12px] leading-tight',\n base: 'px-5 pb-[10px] pt-[11px] text-[14px] leading-tight',\n lg: 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight',\n icon: 'size-10 rounded-full leading-tight',\n },\n /** hover \u72B6\u6001\u4E0B\u7684\u52A8\u753B\u6548\u679C,\u9700\u8981\u6CE8\u610F\u4E0D\u540Cvariant \u4E0B\u7684\u6548\u679C */\n hoverEffect: {\n none: '',\n slide: '',\n },\n state: {\n default: '',\n disabled: '',\n loading: '',\n },\n },\n compoundVariants: [\n {\n variant: 'primary',\n hoverEffect: 'slide',\n class:\n 'before:rounded-btn hover:!bg-btn-primary before:bg-btn-primary-active relative z-[1] overflow-hidden before:absolute before:inset-y-0 before:-z-[1] before:w-full before:-translate-x-full before:transition-transform before:duration-300 before:ease-in-out before:content-[\"\"] hover:before:translate-x-0',\n },\n {\n variant: 'secondary',\n hoverEffect: 'slide',\n class:\n 'before:rounded-btn hover:!bg-btn-secondary before:bg-btn-secondary-active relative z-[1] overflow-hidden before:absolute before:inset-y-0 before:-z-[1] before:w-full before:-translate-x-full before:transition-transform before:duration-300 before:ease-in-out before:content-[\"\"] hover:before:translate-x-0',\n },\n {\n variant: 'primary',\n state: 'loading',\n class: 'bg-btn-primary-active disabled:border-btn-primary-disabled-border',\n },\n {\n variant: 'secondary',\n state: 'loading',\n class:\n 'bg-btn-secondary disabled:bg-btn-secondary-disabled disabled:text-btn-secondary-disabled-foreground disabled:border-btn-primary-disabled',\n },\n {\n variant: 'primary',\n state: 'disabled',\n class:\n 'disabled:bg-btn-primary-disabled disabled:text-btn-primary-disabled-foreground disabled:border-btn-primary-disabled',\n },\n {\n variant: 'secondary',\n state: 'disabled',\n class:\n 'disabled:bg-btn-secondary-disabled disabled:text-btn-secondary-disabled-foreground disabled:border-btn-secondary-disabled-border disabled:outline-btn-secondary-disabled-border',\n },\n {\n variant: 'link',\n state: 'disabled',\n class: 'disabled:text-info-quaternary',\n },\n ],\n defaultVariants: {\n variant: 'primary',\n size: 'lg',\n hoverEffect: 'none',\n state: 'default',\n },\n }\n)\n\nconst loadingSvgVariants = cva('', {\n variants: {\n variant: {\n primary: 'stroke-btn-primary-foreground',\n secondary: 'stroke-btn-secondary-foreground',\n link: 'stroke-[var(--stroke-primary-color)]',\n ghost: 'stroke-[var(--stroke-primary-color)]',\n },\n },\n defaultVariants: {\n variant: 'primary',\n },\n})\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {\n /** \u8BBE\u7F6E\u6309\u94AE\u8F7D\u5165\u72B6\u6001 */\n loading?: boolean\n /** \u8BBE\u7F6E\u6309\u94AE\u5931\u6548\u72B6\u6001 */\n disabled?: boolean\n /** \u5B9A\u4E49\u81EA\u7EC4\u4EF6\u4F5C\u4E3A\u7236\u7EC4\u4EF6\u7684\u7C7B\u578B\uFF0C \u8BE6\u7EC6\u4F7F\u7528\u65B9\u5F0F\u8BF7\u53C2\u8003radix-ui (\u5DF2\u4F5C\u5E9F\u8BF7\u52FF\u4F7F\u7528) */\n asChild?: boolean\n /** \u5B9A\u4E49\u81EA\u7EC4\u4EF6\u4F5C\u4E3A\u7236\u7EC4\u4EF6\u7684\u7C7B\u578B\uFF0C \u8BE6\u7EC6\u4F7F\u7528\u65B9\u5F0F\u8BF7\u53C2\u8003radix-ui */\n as?: 'button' | 'a'\n href?: string\n /** \u94FE\u63A5\u76EE\u6807\uFF0C\u4EC5\u5728 as=\"a\" \u65F6\u751F\u6548\uFF0C\u5982 \"_blank\" \u53EF\u5728\u65B0\u7A97\u53E3\u6253\u5F00 */\n target?: React.AnchorHTMLAttributes<HTMLAnchorElement>['target']\n /** \u94FE\u63A5 rel \u5C5E\u6027\uFF0C\u4EC5\u5728 as=\"a\" \u65F6\u751F\u6548 */\n rel?: React.AnchorHTMLAttributes<HTMLAnchorElement>['rel']\n iconClassName?: string\n /** \u81EA\u5B9A\u4E49loading */\n spinner?: React.ReactNode\n}\n\n/**\n * Button - \u6309\u94AE\n *\n * @description \u53EF\u70B9\u51FB\u7684\u4EA4\u4E92\u5F0F\u6309\u94AE\u7EC4\u4EF6\uFF0C\u652F\u6301\u591A\u79CD\u6837\u5F0F\u3001\u5927\u5C0F\u3001\u72B6\u6001\u548C\u52A0\u8F7D\u6548\u679C\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n // eslint-disable-next-line\n asChild = false,\n as = 'button',\n href,\n target,\n rel,\n size = 'lg',\n children,\n variant,\n hoverEffect = 'none',\n className,\n disabled = false,\n loading = false,\n spinner,\n iconClassName,\n ...props\n }: ButtonProps,\n ref\n ) => {\n const Comp = as\n const isInactive = disabled || loading\n const state = loading ? 'loading' : disabled ? 'disabled' : 'default'\n\n return (\n <Comp\n disabled={isInactive}\n className={cn(buttonVariants({ variant, size, hoverEffect, state }), className)}\n ref={ref as any}\n {...(as === 'a' ? { href, target, rel } : {})}\n {...(props as any)}\n >\n {loading ? (\n <>\n <span style={{ display: 'contents', visibility: 'hidden' }} aria-hidden>\n {children}\n </span>\n <span className=\"absolute\">\n {spinner ? (\n spinner\n ) : (\n <Spinner\n className={loadingSvgVariants({\n variant,\n })}\n />\n )}\n </span>\n <VisuallyHidden>{children}</VisuallyHidden>\n </>\n ) : (\n <>\n {children}\n {variant === 'link' && size && size !== 'icon' && (\n <LinkButtonAppendIcon className={iconClassName} size={size} />\n )}\n </>\n )}\n </Comp>\n )\n }\n)\n\nButton.displayName = 'Button'\nexport default Button\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "React", "VisuallyHidden", "cva", "Spinner", "cn", "sizeMap", "LinkButtonAppendIcon", "size", "rest", "width", "height", "buttonVariants", "loadingSvgVariants", "Button", "asChild", "as", "href", "target", "rel", "children", "variant", "hoverEffect", "className", "disabled", "loading", "spinner", "iconClassName", "props", "ref", "button_default"]
|
|
7
7
|
}
|
|
@@ -4,7 +4,7 @@ export { Input, InputSlot } from './input.js';
|
|
|
4
4
|
export { default as Checkbox } from './checkbox.js';
|
|
5
5
|
export { default as Skeleton } from './skeleton.js';
|
|
6
6
|
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, } from './dialog.js';
|
|
7
|
-
export { Popover, PopoverTrigger, PopoverContent } from './popover.js';
|
|
7
|
+
export { Popover, PopoverTrigger, PopoverAnchor, PopoverContent, PopoverClose, PopoverArrow } from './popover.js';
|
|
8
8
|
export { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps } from './radio.js';
|
|
9
9
|
export { Text, type TextProps } from './text.js';
|
|
10
10
|
export { Grid, GridItem, type GridProps, type GridItemProps } from './grid.js';
|
|
@@ -28,6 +28,8 @@ export { default as LoadingDots } from './loadingDots.js';
|
|
|
28
28
|
export { ExposureDetector, type ExposureDetectorProps } from './ExposureDetector.js';
|
|
29
29
|
export { default as BrandStrip } from './brand-strip.js';
|
|
30
30
|
export { default as Progress, type ProgressProps, type ProgressClassNames } from './progress.js';
|
|
31
|
+
export { Toast, useToast, type ToastProps, type UseToastOptions } from './toast.js';
|
|
32
|
+
export { default as Breadcrumb, type BreadcrumbProps, type BreadcrumbItem } from './breadcrumb.js';
|
|
31
33
|
export { default as OtpInput, type OtpInputProps } from './otp-input.js';
|
|
32
34
|
export { sizeMap } from './button.js';
|
|
33
35
|
export type { ButtonProps } from './button.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{default as e}from"./button.js";import{default as p}from"./badge.js";import{Input as n,InputSlot as s}from"./input.js";import{default as d}from"./checkbox.js";import{default as i}from"./skeleton.js";import{Dialog as
|
|
1
|
+
import{default as e}from"./button.js";import{default as p}from"./badge.js";import{Input as n,InputSlot as s}from"./input.js";import{default as d}from"./checkbox.js";import{default as i}from"./skeleton.js";import{Dialog as f,DialogPortal as x,DialogOverlay as D,DialogClose as C,DialogTrigger as P,DialogContent as g,DialogHeader as w,DialogFooter as y,DialogTitle as T,DialogDescription as b}from"./dialog.js";import{Popover as M,PopoverTrigger as c,PopoverAnchor as v,PopoverContent as G,PopoverClose as A,PopoverArrow as B}from"./popover.js";import{RadioGroup as k,RadioGroupItem as R}from"./radio.js";import{Text as H}from"./text.js";import{Grid as O,GridItem as F}from"./grid.js";import{Heading as E}from"./heading.js";import{Container as z}from"./container.js";import{Color as q}from"./color.js";import{Drawer as K,DrawerPortal as Q,DrawerOverlay as V,DrawerTrigger as W,DrawerClose as X,DrawerContent as Y,DrawerHeader as Z,DrawerFooter as _,DrawerTitle as $,DrawerDescription as oo}from"./drawer.js";import{default as eo}from"./link.js";import{Avatar as po,AvatarImage as ao,AvatarFallback as no}from"./avatar.js";import{default as uo}from"./input-number.js";import{DropdownMenu as io,DropdownMenuTrigger as mo,DropdownMenuContent as fo,DropdownMenuItem as xo,DropdownMenuCheckboxItem as Do,DropdownMenuRadioItem as Co,DropdownMenuLabel as Po,DropdownMenuSeparator as go,DropdownMenuShortcut as wo,DropdownMenuGroup as yo,DropdownMenuPortal as To,DropdownMenuSub as bo,DropdownMenuSubContent as Io,DropdownMenuSubTrigger as Mo,DropdownMenuRadioGroup as co}from"./drop-down.js";import{Card as Go,CardHeader as Ao,CardFooter as Bo,CardTitle as So,CardDescription as ko,CardContent as Ro}from"./card.js";import{default as Ho}from"./Countdown.js";import{Carousel as Oo,CarouselContent as Fo,CarouselItem as No,CarouselPrevious as Eo,CarouselNext as jo}from"./carousel.js";import{Tabs as Uo,TabsList as qo,TabsTrigger as Jo,TabsContent as Ko}from"./tabs.js";import{Alert as Vo,AlertTitle as Wo,AlertDescription as Xo}from"./alert.js";import{default as Zo}from"./picture.js";import{default as $o}from"./theme.js";import{default as rr}from"./board.js";import{default as tr}from"./loadingDots.js";import{ExposureDetector as ar}from"./ExposureDetector.js";import{default as sr}from"./brand-strip.js";import{default as dr}from"./progress.js";import{Toast as ir,useToast as mr}from"./toast.js";import{default as xr}from"./breadcrumb.js";import{default as Cr}from"./otp-input.js";import{sizeMap as gr}from"./button.js";export{Vo as Alert,Xo as AlertDescription,Wo as AlertTitle,po as Avatar,no as AvatarFallback,ao as AvatarImage,p as Badge,rr as Board,sr as BrandStrip,xr as Breadcrumb,e as Button,Go as Card,Ro as CardContent,ko as CardDescription,Bo as CardFooter,Ao as CardHeader,So as CardTitle,Oo as Carousel,Fo as CarouselContent,No as CarouselItem,jo as CarouselNext,Eo as CarouselPrevious,d as Checkbox,q as Color,z as Container,Ho as Countdown,f as Dialog,C as DialogClose,g as DialogContent,b as DialogDescription,y as DialogFooter,w as DialogHeader,D as DialogOverlay,x as DialogPortal,T as DialogTitle,P as DialogTrigger,K as Drawer,X as DrawerClose,Y as DrawerContent,oo as DrawerDescription,_ as DrawerFooter,Z as DrawerHeader,V as DrawerOverlay,Q as DrawerPortal,$ as DrawerTitle,W as DrawerTrigger,io as DropdownMenu,Do as DropdownMenuCheckboxItem,fo as DropdownMenuContent,yo as DropdownMenuGroup,xo as DropdownMenuItem,Po as DropdownMenuLabel,To as DropdownMenuPortal,co as DropdownMenuRadioGroup,Co as DropdownMenuRadioItem,go as DropdownMenuSeparator,wo as DropdownMenuShortcut,bo as DropdownMenuSub,Io as DropdownMenuSubContent,Mo as DropdownMenuSubTrigger,mo as DropdownMenuTrigger,ar as ExposureDetector,O as Grid,F as GridItem,E as Heading,n as Input,uo as InputNumber,s as InputSlot,eo as Link,tr as LoadingDots,Cr as OtpInput,Zo as Picture,M as Popover,v as PopoverAnchor,B as PopoverArrow,A as PopoverClose,G as PopoverContent,c as PopoverTrigger,dr as Progress,k as RadioGroup,R as RadioGroupItem,i as Skeleton,Uo as Tabs,Ko as TabsContent,qo as TabsList,Jo as TabsTrigger,H as Text,$o as Theme,ir as Toast,gr as sizeMap,mr as useToast};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { default as Button } from './button.js'\nexport { default as Badge } from './badge.js'\nexport { Input, InputSlot } from './input.js'\n\nexport { default as Checkbox } from './checkbox.js'\n\nexport { default as Skeleton } from './skeleton.js'\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './dialog.js'\nexport { Popover, PopoverTrigger, PopoverContent } from './popover.js'\nexport { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps } from './radio.js'\nexport { Text, type TextProps } from './text.js'\nexport { Grid, GridItem, type GridProps, type GridItemProps } from './grid.js'\nexport { Heading, type HeadingProps } from './heading.js'\nexport { Container, type ContainerProps } from './container.js'\nexport { Color, type ColorProps } from './color.js'\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n} from './drawer.js'\nexport { default as Link, type LinkProps } from './link.js'\nexport { Avatar, AvatarImage, AvatarFallback } from './avatar.js'\nexport { default as InputNumber, type InputNumberProps } from './input-number.js'\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n} from './drop-down.js'\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from './card.js'\nexport { default as Countdown, type CountdownProps } from './Countdown.js'\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n} from './carousel.js'\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from './tabs.js'\nexport { Alert, AlertTitle, AlertDescription } from './alert.js'\nexport { default as Picture } from './picture.js'\nexport { default as Theme } from './theme.js'\nexport { default as Board, type BoardProps } from './board.js'\nexport { default as LoadingDots } from './loadingDots.js'\nexport { ExposureDetector, type ExposureDetectorProps } from './ExposureDetector.js'\nexport { default as BrandStrip } from './brand-strip.js'\nexport { default as Progress, type ProgressProps, type ProgressClassNames } from './progress.js'\nexport { default as OtpInput, type OtpInputProps } from './otp-input.js'\n\n// \u516C\uAC1C\u5BFC\u51FA button \u5185\u90E8\u5DE5\u5177\uFF08\u4F9B Registry \u5206\u53D1\u7684 biz-components \u4F7F\u7528\uFF09\nexport { sizeMap } from './button.js'\nexport type { ButtonProps } from './button.js'\n"],
|
|
5
|
-
"mappings": "AAAA,OAAoB,WAAXA,MAAyB,cAClC,OAAoB,WAAXA,MAAwB,aACjC,OAAS,SAAAC,EAAO,aAAAC,MAAiB,aAEjC,OAAoB,WAAXF,MAA2B,gBAEpC,OAAoB,WAAXA,MAA2B,gBACpC,OACE,UAAAG,EACA,gBAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,qBAAAC,MACK,cACP,OAAS,WAAAC,EAAS,kBAAAC,EAAgB,kBAAAC,
|
|
6
|
-
"names": ["default", "Input", "InputSlot", "Dialog", "DialogPortal", "DialogOverlay", "DialogClose", "DialogTrigger", "DialogContent", "DialogHeader", "DialogFooter", "DialogTitle", "DialogDescription", "Popover", "PopoverTrigger", "PopoverContent", "RadioGroup", "RadioGroupItem", "Text", "Grid", "GridItem", "Heading", "Container", "Color", "Drawer", "DrawerPortal", "DrawerOverlay", "DrawerTrigger", "DrawerClose", "DrawerContent", "DrawerHeader", "DrawerFooter", "DrawerTitle", "DrawerDescription", "Avatar", "AvatarImage", "AvatarFallback", "DropdownMenu", "DropdownMenuTrigger", "DropdownMenuContent", "DropdownMenuItem", "DropdownMenuCheckboxItem", "DropdownMenuRadioItem", "DropdownMenuLabel", "DropdownMenuSeparator", "DropdownMenuShortcut", "DropdownMenuGroup", "DropdownMenuPortal", "DropdownMenuSub", "DropdownMenuSubContent", "DropdownMenuSubTrigger", "DropdownMenuRadioGroup", "Card", "CardHeader", "CardFooter", "CardTitle", "CardDescription", "CardContent", "Carousel", "CarouselContent", "CarouselItem", "CarouselPrevious", "CarouselNext", "Tabs", "TabsList", "TabsTrigger", "TabsContent", "Alert", "AlertTitle", "AlertDescription", "ExposureDetector", "sizeMap"]
|
|
4
|
+
"sourcesContent": ["export { default as Button } from './button.js'\nexport { default as Badge } from './badge.js'\nexport { Input, InputSlot } from './input.js'\n\nexport { default as Checkbox } from './checkbox.js'\n\nexport { default as Skeleton } from './skeleton.js'\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n} from './dialog.js'\nexport { Popover, PopoverTrigger, PopoverAnchor, PopoverContent, PopoverClose, PopoverArrow } from './popover.js'\nexport { RadioGroup, RadioGroupItem, type RadioGroupProps, type RadioGroupItemProps } from './radio.js'\nexport { Text, type TextProps } from './text.js'\nexport { Grid, GridItem, type GridProps, type GridItemProps } from './grid.js'\nexport { Heading, type HeadingProps } from './heading.js'\nexport { Container, type ContainerProps } from './container.js'\nexport { Color, type ColorProps } from './color.js'\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n} from './drawer.js'\nexport { default as Link, type LinkProps } from './link.js'\nexport { Avatar, AvatarImage, AvatarFallback } from './avatar.js'\nexport { default as InputNumber, type InputNumberProps } from './input-number.js'\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n} from './drop-down.js'\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from './card.js'\nexport { default as Countdown, type CountdownProps } from './Countdown.js'\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n} from './carousel.js'\nexport { Tabs, TabsList, TabsTrigger, TabsContent } from './tabs.js'\nexport { Alert, AlertTitle, AlertDescription } from './alert.js'\nexport { default as Picture } from './picture.js'\nexport { default as Theme } from './theme.js'\nexport { default as Board, type BoardProps } from './board.js'\nexport { default as LoadingDots } from './loadingDots.js'\nexport { ExposureDetector, type ExposureDetectorProps } from './ExposureDetector.js'\nexport { default as BrandStrip } from './brand-strip.js'\nexport { default as Progress, type ProgressProps, type ProgressClassNames } from './progress.js'\nexport { Toast, useToast, type ToastProps, type UseToastOptions } from './toast.js'\nexport { default as Breadcrumb, type BreadcrumbProps, type BreadcrumbItem } from './breadcrumb.js'\nexport { default as OtpInput, type OtpInputProps } from './otp-input.js'\n\n// \u516C\uAC1C\u5BFC\u51FA button \u5185\u90E8\u5DE5\u5177\uFF08\u4F9B Registry \u5206\u53D1\u7684 biz-components \u4F7F\u7528\uFF09\nexport { sizeMap } from './button.js'\nexport type { ButtonProps } from './button.js'\n"],
|
|
5
|
+
"mappings": "AAAA,OAAoB,WAAXA,MAAyB,cAClC,OAAoB,WAAXA,MAAwB,aACjC,OAAS,SAAAC,EAAO,aAAAC,MAAiB,aAEjC,OAAoB,WAAXF,MAA2B,gBAEpC,OAAoB,WAAXA,MAA2B,gBACpC,OACE,UAAAG,EACA,gBAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,qBAAAC,MACK,cACP,OAAS,WAAAC,EAAS,kBAAAC,EAAgB,iBAAAC,EAAe,kBAAAC,EAAgB,gBAAAC,EAAc,gBAAAC,MAAoB,eACnG,OAAS,cAAAC,EAAY,kBAAAC,MAAsE,aAC3F,OAAS,QAAAC,MAA4B,YACrC,OAAS,QAAAC,EAAM,YAAAC,MAAoD,YACnE,OAAS,WAAAC,MAAkC,eAC3C,OAAS,aAAAC,MAAsC,iBAC/C,OAAS,SAAAC,MAA8B,aACvC,OACE,UAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,qBAAAC,OACK,cACP,OAAoB,WAAXpC,OAAuC,YAChD,OAAS,UAAAqC,GAAQ,eAAAC,GAAa,kBAAAC,OAAsB,cACpD,OAAoB,WAAXvC,OAAqD,oBAC9D,OACE,gBAAAwC,GACA,uBAAAC,GACA,uBAAAC,GACA,oBAAAC,GACA,4BAAAC,GACA,yBAAAC,GACA,qBAAAC,GACA,yBAAAC,GACA,wBAAAC,GACA,qBAAAC,GACA,sBAAAC,GACA,mBAAAC,GACA,0BAAAC,GACA,0BAAAC,GACA,0BAAAC,OACK,iBACP,OAAS,QAAAC,GAAM,cAAAC,GAAY,cAAAC,GAAY,aAAAC,GAAW,mBAAAC,GAAiB,eAAAC,OAAmB,YACtF,OAAoB,WAAX5D,OAAiD,iBAC1D,OAEE,YAAA6D,GACA,mBAAAC,GACA,gBAAAC,GACA,oBAAAC,GACA,gBAAAC,OACK,gBACP,OAAS,QAAAC,GAAM,YAAAC,GAAU,eAAAC,GAAa,eAAAC,OAAmB,YACzD,OAAS,SAAAC,GAAO,cAAAC,GAAY,oBAAAC,OAAwB,aACpD,OAAoB,WAAXxE,OAA0B,eACnC,OAAoB,WAAXA,OAAwB,aACjC,OAAoB,WAAXA,OAAyC,aAClD,OAAoB,WAAXA,OAA8B,mBACvC,OAAS,oBAAAyE,OAAoD,wBAC7D,OAAoB,WAAXzE,OAA6B,mBACtC,OAAoB,WAAXA,OAAwE,gBACjF,OAAS,SAAA0E,GAAO,YAAAC,OAAuD,aACvE,OAAoB,WAAX3E,OAAwE,kBACjF,OAAoB,WAAXA,OAA+C,iBAGxD,OAAS,WAAA4E,OAAe",
|
|
6
|
+
"names": ["default", "Input", "InputSlot", "Dialog", "DialogPortal", "DialogOverlay", "DialogClose", "DialogTrigger", "DialogContent", "DialogHeader", "DialogFooter", "DialogTitle", "DialogDescription", "Popover", "PopoverTrigger", "PopoverAnchor", "PopoverContent", "PopoverClose", "PopoverArrow", "RadioGroup", "RadioGroupItem", "Text", "Grid", "GridItem", "Heading", "Container", "Color", "Drawer", "DrawerPortal", "DrawerOverlay", "DrawerTrigger", "DrawerClose", "DrawerContent", "DrawerHeader", "DrawerFooter", "DrawerTitle", "DrawerDescription", "Avatar", "AvatarImage", "AvatarFallback", "DropdownMenu", "DropdownMenuTrigger", "DropdownMenuContent", "DropdownMenuItem", "DropdownMenuCheckboxItem", "DropdownMenuRadioItem", "DropdownMenuLabel", "DropdownMenuSeparator", "DropdownMenuShortcut", "DropdownMenuGroup", "DropdownMenuPortal", "DropdownMenuSub", "DropdownMenuSubContent", "DropdownMenuSubTrigger", "DropdownMenuRadioGroup", "Card", "CardHeader", "CardFooter", "CardTitle", "CardDescription", "CardContent", "Carousel", "CarouselContent", "CarouselItem", "CarouselPrevious", "CarouselNext", "Tabs", "TabsList", "TabsTrigger", "TabsContent", "Alert", "AlertTitle", "AlertDescription", "ExposureDetector", "Toast", "useToast", "sizeMap"]
|
|
7
7
|
}
|
|
@@ -12,6 +12,17 @@ type InputNumberProps = {
|
|
|
12
12
|
asChild?: boolean;
|
|
13
13
|
/** 类名*/
|
|
14
14
|
className?: string;
|
|
15
|
+
/** 自定义各部分的 className */
|
|
16
|
+
classNames?: {
|
|
17
|
+
/** 根元素 */
|
|
18
|
+
root?: string;
|
|
19
|
+
/** 输入框Wrapper */
|
|
20
|
+
inputWrapper?: string;
|
|
21
|
+
/** 输入框 */
|
|
22
|
+
input?: string;
|
|
23
|
+
/** 加减按钮 */
|
|
24
|
+
button?: string;
|
|
25
|
+
};
|
|
15
26
|
/** 输入框下方提示文本,会根据不同的 status 呈现不同的样式*/
|
|
16
27
|
tips?: string;
|
|
17
28
|
/** 文本框状态*/
|
|
@@ -49,6 +60,17 @@ declare const InputNumber: React.ForwardRefExoticComponent<{
|
|
|
49
60
|
asChild?: boolean;
|
|
50
61
|
/** 类名*/
|
|
51
62
|
className?: string;
|
|
63
|
+
/** 自定义各部分的 className */
|
|
64
|
+
classNames?: {
|
|
65
|
+
/** 根元素 */
|
|
66
|
+
root?: string;
|
|
67
|
+
/** 输入框Wrapper */
|
|
68
|
+
inputWrapper?: string;
|
|
69
|
+
/** 输入框 */
|
|
70
|
+
input?: string;
|
|
71
|
+
/** 加减按钮 */
|
|
72
|
+
button?: string;
|
|
73
|
+
};
|
|
52
74
|
/** 输入框下方提示文本,会根据不同的 status 呈现不同的样式*/
|
|
53
75
|
tips?: string;
|
|
54
76
|
/** 文本框状态*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as $,jsx as r,jsxs as V}from"react/jsx-runtime";import{cn as l}from"../helpers/index.js";import{Slot as S}from"@radix-ui/react-slot";import{useState as F,useEffect as q,forwardRef as A}from"react";import{cva as D}from"class-variance-authority";const j=({className:i})=>r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:i,children:r("path",{d:"M13.3332 8L2.6665 8.00075",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round"})}),O=({className:i})=>r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:i,children:r("path",{d:"M13.3335 7.60956C13.7015 7.60972 14.0001 7.90808 14.0001 8.27616C14 8.64433 13.7012 8.94319 13.333 8.94321H8.66593V13.6094C8.66585 13.9774 8.36733 14.2758 7.99933 14.276C7.63114 14.276 7.33271 13.9776 7.33274 13.6094V8.94321L2.66611 8.94368C2.29808 8.94355 1.99955 8.64512 1.99951 8.27708C1.99954 7.90889 2.29838 7.61005 2.66657 7.61002L7.3332 7.60956V2.94247C7.33336 2.57441 7.6317 2.27592 7.99979 2.27588C8.36793 2.27585 8.66633 2.57436 8.66639 2.94247V7.60956H13.3335Z",fill:"currentColor"})}),Z=D("size-full border bg-transparent text-center text-base outline-none",{variants:{status:{default:"border-lines-1 group-hover:border-lines-2",success:"border-lines-3 group-hover:border-lines-3",warning:"border-lines-4 group-hover:border-lines-4",error:"border-lines-5 group-hover:border-lines-5"},disabled:{true:"border-lines-1 group-hover:border-lines-1 text-info-quaternary cursor-not-allowed"}}}),y=A(({value:i,defaultValue:E=0,step:m=1,min:o=0,max:s,tips:N,style:w,children:I,asChild:b=!1,disabled:t=!1,readonly:a=!1,status:h="default",className:P,classNames:f,onChange:d,onBlur:C,onEnter:M},R)=>{const[u,p]=F(E),k=b?S:"div",x=l("border-lines-1 flex size-12 items-center justify-center border text-base",{"group-hover:border-lines-2":!t,"text-info-quaternary cursor-not-allowed":t},f?.button),z=(e,n)=>n?"text-lines-1":{default:"text-lines-1",success:"text-lines-3",warning:"text-lines-4",error:"text-lines-5"}[e||"default"],L=e=>e===""||/^[0-9]+$/.test(e),T=e=>{if(t||a)return;const n=e.target.value;if(L(n)&&(p(n),n!=="")){let c=Number(n);s!==void 0&&c>s&&(c=s),o!==void 0&&c<o&&(c=o),d?.(c)}},W=e=>{if(!(t||a))if(u===""||isNaN(Number(u))){const n=o!==void 0?o:0;p(n),C?.(n,e)}else{const n=Number(u);p(n),C?.(n,e)}},v=s!==void 0&&Number(u)>=s,g=o!==void 0&&Number(u)<=o,B=()=>{if(t||a||v)return;let e=Number(u)+(m?Math.ceil(Number(m)):1);s!==void 0&&e>s&&(e=s),p(e),d?.(e)},H=()=>{if(t||a||g)return;let e=Number(u)-(m?Math.ceil(Number(m)):1);o!==void 0&&e<o&&(e=o),p(e),d?.(e)},K=e=>{if(!(t||a)&&e.key==="Enter"){const n=e.target?.value;M?.(n,e)}};return q(()=>{p(i||0)},[i]),r(k,{ref:R,...w?{style:w}:null,className:l({"group flex items-center":!b},f?.root,P),children:b?I:V($,{children:[r("button",{onClick:H,disabled:t||g,className:l(x,{"cursor-not-allowed text-lines-1":t||g}),children:r(j,{className:"tablet:size-4 size-3"})}),V("div",{className:l("relative mx-1.5 h-[52px] w-[105px]",f?.inputWrapper),children:[r("input",{type:"text",value:u,disabled:t,readOnly:a,onBlur:W,onKeyDown:K,onChange:T,className:l(Z({status:h,disabled:t}),f?.input)}),N?r("span",{className:l(z(h,t),"absolute -bottom-4 left-0 w-full truncate text-xs"),children:N}):null]}),r("button",{onClick:B,disabled:t||v,className:l(x,{"cursor-not-allowed text-lines-1":t||v}),children:r(O,{className:"tablet:size-4 size-3"})})]})})});y.displayName="InputNumber";var Y=y;export{Y as default};
|
|
2
2
|
//# sourceMappingURL=input-number.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/input-number.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["Fragment", "jsx", "jsxs", "cn", "Slot", "
|
|
4
|
+
"sourcesContent": ["'use client'\nimport { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport React, { useState, useEffect, forwardRef } from 'react'\nimport type { ChangeEvent, KeyboardEvent, FocusEvent } from 'react'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\n\nconst MinusIcon = ({ className }: { className?: string }) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" className={className}>\n <path d=\"M13.3332 8L2.6665 8.00075\" stroke=\"currentColor\" strokeWidth=\"1.33333\" strokeLinecap=\"round\" />\n </svg>\n)\n\nconst PlusIcon = ({ className }: { className?: string }) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" className={className}>\n <path\n d=\"M13.3335 7.60956C13.7015 7.60972 14.0001 7.90808 14.0001 8.27616C14 8.64433 13.7012 8.94319 13.333 8.94321H8.66593V13.6094C8.66585 13.9774 8.36733 14.2758 7.99933 14.276C7.63114 14.276 7.33271 13.9776 7.33274 13.6094V8.94321L2.66611 8.94368C2.29808 8.94355 1.99955 8.64512 1.99951 8.27708C1.99954 7.90889 2.29838 7.61005 2.66657 7.61002L7.3332 7.60956V2.94247C7.33336 2.57441 7.6317 2.27592 7.99979 2.27588C8.36793 2.27585 8.66633 2.57436 8.66639 2.94247V7.60956H13.3335Z\"\n fill=\"currentColor\"\n />\n </svg>\n)\n\n// \u5B9A\u4E49 InputNumber \u7684\u6837\u5F0F\u53D8\u4F53\nconst InputNumberVariants = cva('size-full border bg-transparent text-center text-base outline-none', {\n variants: {\n status: {\n default: 'border-lines-1 group-hover:border-lines-2',\n success: 'border-lines-3 group-hover:border-lines-3',\n warning: 'border-lines-4 group-hover:border-lines-4',\n error: 'border-lines-5 group-hover:border-lines-5',\n },\n disabled: {\n true: 'border-lines-1 group-hover:border-lines-1 text-info-quaternary cursor-not-allowed',\n },\n },\n})\n\ntype ColorType = 'default' | 'success' | 'warning' | 'error' | null\n\n// \u5B9A\u4E49\u7EC4\u4EF6\u7C7B\u578B\uFF0C\u7EE7\u627F div \u6807\u7B7E\u6807\u51C6\u5C5E\u6027\ntype InputNumberElement = React.ElementRef<'div'>\n\ntype InputNumberProps = {\n /** \u5B9A\u4E49\u5B50\u7EC4\u4EF6\u4F5C\u4E3A\u7236\u7EC4\u4EF6\u7684\u7C7B\u578B,\u8BE6\u7EC6\u4F7F\u7528\u65B9\u5F0F\u8BF7\u53C2\u8003radix-ui */\n asChild?: boolean\n /** \u7C7B\u540D*/\n className?: string\n /** \u81EA\u5B9A\u4E49\u5404\u90E8\u5206\u7684 className */\n classNames?: {\n /** \u6839\u5143\u7D20 */\n root?: string\n /** \u8F93\u5165\u6846Wrapper */\n inputWrapper?: string\n /** \u8F93\u5165\u6846 */\n input?: string\n /** \u52A0\u51CF\u6309\u94AE */\n button?: string\n }\n /** \u8F93\u5165\u6846\u4E0B\u65B9\u63D0\u793A\u6587\u672C\uFF0C\u4F1A\u6839\u636E\u4E0D\u540C\u7684 status \u5448\u73B0\u4E0D\u540C\u7684\u6837\u5F0F*/\n tips?: string\n /** \u6587\u672C\u6846\u72B6\u6001*/\n status?: ColorType\n /** \u6570\u5B57\u8F93\u5165\u6846\u7684\u503C */\n value?: number\n /** \u6570\u5B57\u8F93\u5165\u6846\u7684\u521D\u59CB\u503C */\n defaultValue?: number\n /** \u6570\u503C\u6539\u53D8\u6B65\u6570 */\n step?: number\n /** \u6700\u5C0F\u503C */\n min?: number\n /** \u6700\u5927\u503C */\n max?: number\n /** \u662F\u5426\u7981\u7528*/\n disabled?: boolean\n /** \u662F\u5426\u53EA\u8BFB*/\n readonly?: boolean\n /** \u6837\u5F0F*/\n style?: React.CSSProperties\n /** \u503C\u53D8\u5316\u65F6\u89E6\u53D1*/\n onChange?: (value: number) => void\n /** \u5931\u53BB\u7126\u70B9\u65F6\u89E6\u53D1*/\n onBlur?: (value: number, e: FocusEvent) => void\n /** \u6309\u4E0B\u56DE\u8F66\u952E\u65F6\u89E6\u53D1*/\n onEnter?: (value: number, e: KeyboardEvent) => void\n} & VariantProps<typeof InputNumberVariants> &\n ComponentPropsWithout<'div', RemovedProps>\n\n/**\n * InputNumber - \u6570\u5B57\u8F93\u5165\u6846\n *\n * @description \u4E13\u7528\u4E8E\u6570\u5B57\u8F93\u5165\u7684\u7EC4\u4EF6\uFF0C\u652F\u6301\u6B65\u8FDB\u8C03\u8282\u3001\u6700\u503C\u9650\u5236\u3001\u72B6\u6001\u63D0\u793A\u548C\u952E\u76D8\u64CD\u4F5C\n */\nconst InputNumber = forwardRef<InputNumberElement, InputNumberProps>(\n (\n {\n value,\n defaultValue = 0,\n step = 1,\n min = 0,\n max,\n tips,\n style,\n children,\n asChild = false,\n disabled = false,\n readonly = false,\n status = 'default',\n className,\n classNames,\n onChange,\n onBlur,\n onEnter,\n },\n ref\n ) => {\n const [inputValue, setInputValue] = useState<number | string>(defaultValue)\n\n const Comp = asChild ? Slot : 'div'\n\n const baseClassName = cn(\n 'border-lines-1 flex size-12 items-center justify-center border text-base',\n {\n 'group-hover:border-lines-2': !disabled,\n 'text-info-quaternary cursor-not-allowed': disabled,\n },\n classNames?.button\n )\n\n const textColor = (type: ColorType, flag: boolean) => {\n if (flag) return 'text-lines-1'\n return {\n default: 'text-lines-1',\n success: 'text-lines-3',\n warning: 'text-lines-4',\n error: 'text-lines-5',\n }[type || 'default']\n }\n\n const isValue = (params: string) => {\n return params === '' || /^[0-9]+$/.test(params)\n }\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n if (disabled || readonly) return\n const value = e.target.value\n // \u5141\u8BB8\u7A7A\u5B57\u7B26\u4E32\uFF0C\u6216\u4EC5\u5305\u542B\u6574\u6570\u7684\u5B57\u7B26\u4E32\n if (isValue(value)) {\n setInputValue(value)\n if (value !== '') {\n let newValue = Number(value)\n if (max !== undefined && newValue > max) {\n newValue = max\n }\n if (min !== undefined && newValue < min) {\n newValue = min\n }\n onChange?.(newValue)\n }\n }\n }\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n if (disabled || readonly) return\n if (inputValue === '' || isNaN(Number(inputValue))) {\n const newValue = min !== undefined ? min : 0\n setInputValue(newValue)\n onBlur?.(newValue, e)\n } else {\n const newValue = Number(inputValue)\n setInputValue(newValue)\n onBlur?.(newValue, e)\n }\n }\n\n const isAtMax = max !== undefined && Number(inputValue) >= max\n const isAtMin = min !== undefined && Number(inputValue) <= min\n\n const increment = () => {\n if (disabled || readonly || isAtMax) return\n let newValue = Number(inputValue) + (step ? Math.ceil(Number(step)) : 1)\n if (max !== undefined && newValue > max) {\n newValue = max\n }\n setInputValue(newValue)\n onChange?.(newValue)\n }\n\n const decrement = () => {\n if (disabled || readonly || isAtMin) return\n let newValue = Number(inputValue) - (step ? Math.ceil(Number(step)) : 1)\n if (min !== undefined && newValue < min) {\n newValue = min\n }\n setInputValue(newValue)\n onChange?.(newValue)\n }\n\n const handleKeyDown = (e: any) => {\n if (disabled || readonly) return\n if (e.key === 'Enter') {\n const initalValue = e.target?.value\n onEnter?.(initalValue, e)\n }\n }\n\n useEffect(() => {\n setInputValue(value || 0)\n }, [value])\n\n return (\n <Comp\n ref={ref}\n {...(style ? { style: style } : null)}\n className={cn({ 'group flex items-center': !asChild }, classNames?.root, className)}\n >\n {asChild ? (\n children\n ) : (\n <>\n <button\n onClick={decrement}\n disabled={disabled || isAtMin}\n className={cn(baseClassName, {\n 'cursor-not-allowed text-lines-1': disabled || isAtMin,\n })}\n >\n <MinusIcon className=\"tablet:size-4 size-3\" />\n </button>\n <div className={cn('relative mx-1.5 h-[52px] w-[105px]', classNames?.inputWrapper)}>\n <input\n type=\"text\"\n value={inputValue}\n disabled={disabled}\n readOnly={readonly}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onChange={handleInputChange}\n className={cn(InputNumberVariants({ status, disabled }), classNames?.input)}\n />\n {tips ? (\n <span className={cn(textColor(status, disabled), 'absolute -bottom-4 left-0 w-full truncate text-xs')}>\n {tips}\n </span>\n ) : null}\n </div>\n <button\n onClick={increment}\n disabled={disabled || isAtMax}\n className={cn(baseClassName, {\n 'cursor-not-allowed text-lines-1': disabled || isAtMax,\n })}\n >\n <PlusIcon className=\"tablet:size-4 size-3\" />\n </button>\n </>\n )}\n </Comp>\n )\n }\n)\n\nInputNumber.displayName = 'InputNumber'\n\nexport default InputNumber\nexport type { InputNumberProps }\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "cn", "Slot", "useState", "useEffect", "forwardRef", "cva", "MinusIcon", "className", "PlusIcon", "InputNumberVariants", "InputNumber", "value", "defaultValue", "step", "min", "max", "tips", "style", "children", "asChild", "disabled", "readonly", "status", "classNames", "onChange", "onBlur", "onEnter", "ref", "inputValue", "setInputValue", "Comp", "baseClassName", "textColor", "type", "flag", "isValue", "params", "handleInputChange", "newValue", "handleBlur", "isAtMax", "isAtMin", "increment", "decrement", "handleKeyDown", "initalValue", "input_number_default"]
|
|
7
7
|
}
|
|
@@ -5,6 +5,11 @@ declare const inputVariants: (props?: ({
|
|
|
5
5
|
size?: "base" | "lg" | "sm" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface InputProps extends ComponentPropsWithout<'input', 'size'>, VariantProps<typeof inputVariants> {
|
|
8
|
+
/**
|
|
9
|
+
* 应用到内部 input 元素的 className
|
|
10
|
+
* 可用于自定义 input 输入框的样式,如字体大小、颜色等
|
|
11
|
+
*/
|
|
12
|
+
inputClassName?: string;
|
|
8
13
|
}
|
|
9
14
|
interface InputSlotProps extends ComponentPropsWithout<'div', RemovedProps> {
|
|
10
15
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as l,jsxs as
|
|
1
|
+
"use client";import{jsx as l,jsxs as c}from"react/jsx-runtime";import*as p from"react";import{cn as s}from"../helpers/index.js";import{cva as m}from"class-variance-authority";const d=m("border-input text-info-primary bg-background rounded-box-small flex w-full flex-row items-center overflow-hidden border focus-visible:outline-none",{variants:{size:{sm:"h-8 text-sm",base:"h-10",lg:"h-12 text-lg"}},defaultVariants:{size:"base"}}),u=p.forwardRef((t,o)=>{const{className:r,side:e="right",children:n,...i}=t;return l("div",{ref:o,...i,className:s("flex h-full items-center",r,{"-order-1":e==="left","order-2":e==="right"}),children:n})}),f=p.forwardRef(({className:t,type:o,size:r,children:e,inputClassName:n,...i},a)=>p.isValidElement(e)?c("div",{className:s(d({size:r}),t),children:[l("input",{type:o,className:s("placeholder:text-muted-foreground flex size-full px-3 file:border-0 file:bg-transparent file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",n),ref:a,...i}),e]}):l("input",{type:o,className:s(d({size:r}),"px-3",n,t),ref:a,...i}));f.displayName="Input",u.displayName="InputSlot";export{f as Input,u as InputSlot};
|
|
2
2
|
//# sourceMappingURL=input.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/input.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst inputVariants = cva(\n 'border-input text-info-primary bg-background rounded-box-small flex w-full flex-row items-center overflow-hidden border focus-visible:outline-none',\n {\n variants: {\n size: {\n sm: 'h-8 text-sm',\n base: 'h-10',\n lg: 'h-12 text-lg',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\nexport interface InputProps extends ComponentPropsWithout<'input', 'size'>, VariantProps<typeof inputVariants> {}\n\ntype InputSlotElement = React.ElementRef<'div'>\ninterface InputSlotProps extends ComponentPropsWithout<'div', RemovedProps> {\n /**\n * \u63D2\u69FD\u7684\u4F4D\u7F6E\n * default: right\n */\n side?: 'left' | 'right'\n}\n\n/**\n * InputSlot\n * \u7528\u6765\u5728 Input \u7EC4\u4EF6\u4E2D\u63D2\u5165\u989D\u5916\u7684\u5185\u5BB9\uFF0C\u6BD4\u5982icon \uFF0C\u6309\u94AE\n */\nconst InputSlot = React.forwardRef<InputSlotElement, InputSlotProps>((props, forwardedRef) => {\n const { className, side = 'right', children, ...slotProps } = props\n\n return (\n <div\n ref={forwardedRef}\n {...slotProps}\n className={cn('flex h-full items-center', className, {\n '-order-1': side === 'left',\n 'order-2': side === 'right',\n })}\n >\n {children}\n </div>\n )\n})\n\n/**\n * Input - \u8F93\u5165\u6846\n *\n * @description \u6587\u672C\u8F93\u5165\u7EC4\u4EF6\uFF0C\u652F\u6301\u5404\u79CD\u8F93\u5165\u7C7B\u578B\u3001\u4E0D\u540C\u5C3A\u5BF8\u548C\u63D2\u69FD\u529F\u80FD\n */\nconst Input = React.forwardRef<React.ElementRef<'input'>, InputProps>(\n ({ className, type, size, children, ...props }, ref) => {\n if (!React.isValidElement(children)) {\n return <input
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "jsxs", "React", "cn", "cva", "inputVariants", "InputSlot", "props", "forwardedRef", "className", "side", "children", "slotProps", "Input", "type", "size", "ref"]
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst inputVariants = cva(\n 'border-input text-info-primary bg-background rounded-box-small flex w-full flex-row items-center overflow-hidden border focus-visible:outline-none',\n {\n variants: {\n size: {\n sm: 'h-8 text-sm',\n base: 'h-10',\n lg: 'h-12 text-lg',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\nexport interface InputProps extends ComponentPropsWithout<'input', 'size'>, VariantProps<typeof inputVariants> {\n /**\n * \u5E94\u7528\u5230\u5185\u90E8 input \u5143\u7D20\u7684 className\n * \u53EF\u7528\u4E8E\u81EA\u5B9A\u4E49 input \u8F93\u5165\u6846\u7684\u6837\u5F0F\uFF0C\u5982\u5B57\u4F53\u5927\u5C0F\u3001\u989C\u8272\u7B49\n */\n inputClassName?: string\n}\n\ntype InputSlotElement = React.ElementRef<'div'>\ninterface InputSlotProps extends ComponentPropsWithout<'div', RemovedProps> {\n /**\n * \u63D2\u69FD\u7684\u4F4D\u7F6E\n * default: right\n */\n side?: 'left' | 'right'\n}\n\n/**\n * InputSlot\n * \u7528\u6765\u5728 Input \u7EC4\u4EF6\u4E2D\u63D2\u5165\u989D\u5916\u7684\u5185\u5BB9\uFF0C\u6BD4\u5982icon \uFF0C\u6309\u94AE\n */\nconst InputSlot = React.forwardRef<InputSlotElement, InputSlotProps>((props, forwardedRef) => {\n const { className, side = 'right', children, ...slotProps } = props\n\n return (\n <div\n ref={forwardedRef}\n {...slotProps}\n className={cn('flex h-full items-center', className, {\n '-order-1': side === 'left',\n 'order-2': side === 'right',\n })}\n >\n {children}\n </div>\n )\n})\n\n/**\n * Input - \u8F93\u5165\u6846\n *\n * @description \u6587\u672C\u8F93\u5165\u7EC4\u4EF6\uFF0C\u652F\u6301\u5404\u79CD\u8F93\u5165\u7C7B\u578B\u3001\u4E0D\u540C\u5C3A\u5BF8\u548C\u63D2\u69FD\u529F\u80FD\n */\nconst Input = React.forwardRef<React.ElementRef<'input'>, InputProps>(\n ({ className, type, size, children, inputClassName, ...props }, ref) => {\n if (!React.isValidElement(children)) {\n return (\n <input\n type={type}\n className={cn(inputVariants({ size }), 'px-3', inputClassName, className)}\n ref={ref}\n {...props}\n />\n )\n }\n return (\n <div className={cn(inputVariants({ size }), className)}>\n <input\n type={type}\n className={cn(\n 'placeholder:text-muted-foreground flex size-full px-3 file:border-0 file:bg-transparent file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50',\n inputClassName\n )}\n ref={ref}\n {...props}\n />\n {children}\n </div>\n )\n }\n)\nInput.displayName = 'Input'\nInputSlot.displayName = 'InputSlot'\n\nexport { Input, InputSlot }\n"],
|
|
5
|
+
"mappings": "aAgDI,cAAAA,EA+BE,QAAAC,MA/BF,oBA9CJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,sBAEnB,OAAS,OAAAC,MAA8B,2BAEvC,MAAMC,EAAgBD,EACpB,qJACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,KAAM,OACN,GAAI,cACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAuBME,EAAYJ,EAAM,WAA6C,CAACK,EAAOC,IAAiB,CAC5F,KAAM,CAAE,UAAAC,EAAW,KAAAC,EAAO,QAAS,SAAAC,EAAU,GAAGC,CAAU,EAAIL,EAE9D,OACEP,EAAC,OACC,IAAKQ,EACJ,GAAGI,EACJ,UAAWT,EAAG,2BAA4BM,EAAW,CACnD,WAAYC,IAAS,OACrB,UAAWA,IAAS,OACtB,CAAC,EAEA,SAAAC,EACH,CAEJ,CAAC,EAOKE,EAAQX,EAAM,WAClB,CAAC,CAAE,UAAAO,EAAW,KAAAK,EAAM,KAAAC,EAAM,SAAAJ,EAAU,eAAAK,EAAgB,GAAGT,CAAM,EAAGU,IACzDf,EAAM,eAAeS,CAAQ,EAWhCV,EAAC,OAAI,UAAWE,EAAGE,EAAc,CAAE,KAAAU,CAAK,CAAC,EAAGN,CAAS,EACnD,UAAAT,EAAC,SACC,KAAMc,EACN,UAAWX,EACT,sLACAa,CACF,EACA,IAAKC,EACJ,GAAGV,EACN,EACCI,GACH,EApBEX,EAAC,SACC,KAAMc,EACN,UAAWX,EAAGE,EAAc,CAAE,KAAAU,CAAK,CAAC,EAAG,OAAQC,EAAgBP,CAAS,EACxE,IAAKQ,EACJ,GAAGV,EACN,CAkBR,EACAM,EAAM,YAAc,QACpBP,EAAU,YAAc",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "cn", "cva", "inputVariants", "InputSlot", "props", "forwardedRef", "className", "side", "children", "slotProps", "Input", "type", "size", "inputClassName", "ref"]
|
|
7
7
|
}
|
|
@@ -2,5 +2,20 @@ import * as React from 'react';
|
|
|
2
2
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
3
|
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
4
|
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
declare const
|
|
6
|
-
|
|
5
|
+
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const PopoverClose: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
8
|
+
/**
|
|
9
|
+
* 设置 data-radix-popper-content-wrapper 的 z-index 值。
|
|
10
|
+
* 底层通过 :has() 选择器精确匹配当前实例,互不影响。
|
|
11
|
+
*/
|
|
12
|
+
zIndex?: number;
|
|
13
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
/**
|
|
15
|
+
* PopoverArrow - 指向触发器的三角形指示箭头
|
|
16
|
+
*
|
|
17
|
+
* @description 渲染在 PopoverContent 内部,Radix 会根据 side/align 自动定位到触发器正上/下/左/右方,
|
|
18
|
+
* 默认填充色与 PopoverContent 背景色一致(bg-primary-foreground),可通过 className 覆盖。
|
|
19
|
+
*/
|
|
20
|
+
declare const PopoverArrow: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverArrowProps & React.RefAttributes<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
21
|
+
export { Popover, PopoverTrigger, PopoverAnchor, PopoverContent, PopoverClose, PopoverArrow };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{Fragment as u,jsx as t,jsxs as w}from"react/jsx-runtime";import*as p from"react";import*as o from"@radix-ui/react-popover";import{cn as s}from"../helpers/utils.js";const v=o.Root,c=o.Trigger,P=o.Anchor,h=o.Close,m=p.forwardRef(({className:r,align:a="center",sideOffset:i=4,zIndex:e,...n},l)=>{const d=p.useId();return t(o.Portal,{children:w(u,{children:[e!==void 0&&t("style",{children:`[data-radix-popper-content-wrapper]:has([data-popover-id="${d}"]){z-index:${e} !important}`}),t(o.Content,{ref:l,align:a,sideOffset:i,"data-popover-id":d,className:s("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",r),...n})]})})});m.displayName=o.Content.displayName;const f=p.forwardRef(({className:r,width:a=16,height:i=8,...e},n)=>t(o.Arrow,{ref:n,width:a,height:i,className:s("fill-white",r),...e}));f.displayName=o.Arrow.displayName;export{v as Popover,P as PopoverAnchor,f as PopoverArrow,h as PopoverClose,m as PopoverContent,c as PopoverTrigger};
|
|
2
2
|
//# sourceMappingURL=popover.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/popover.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as PopoverPrimitive from '@radix-ui/react-popover'\n\nimport { cn } from '../helpers/utils.js'\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "React", "PopoverPrimitive", "cn", "Popover", "PopoverTrigger", "PopoverContent", "className", "align", "sideOffset", "props", "ref"]
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as PopoverPrimitive from '@radix-ui/react-popover'\n\nimport { cn } from '../helpers/utils.js'\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverClose = PopoverPrimitive.Close\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {\n /**\n * \u8BBE\u7F6E data-radix-popper-content-wrapper \u7684 z-index \u503C\u3002\n * \u5E95\u5C42\u901A\u8FC7 :has() \u9009\u62E9\u5668\u7CBE\u786E\u5339\u914D\u5F53\u524D\u5B9E\u4F8B\uFF0C\u4E92\u4E0D\u5F71\u54CD\u3002\n */\n zIndex?: number\n }\n>(({ className, align = 'center', sideOffset = 4, zIndex, ...props }, ref) => {\n const popoverId = React.useId()\n\n return (\n <PopoverPrimitive.Portal>\n <>\n {zIndex !== undefined && (\n <style>{`[data-radix-popper-content-wrapper]:has([data-popover-id=\"${popoverId}\"]){z-index:${zIndex} !important}`}</style>\n )}\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n data-popover-id={popoverId}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none',\n className\n )}\n {...props}\n />\n </>\n </PopoverPrimitive.Portal>\n )\n})\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\n/**\n * PopoverArrow - \u6307\u5411\u89E6\u53D1\u5668\u7684\u4E09\u89D2\u5F62\u6307\u793A\u7BAD\u5934\n *\n * @description \u6E32\u67D3\u5728 PopoverContent \u5185\u90E8\uFF0CRadix \u4F1A\u6839\u636E side/align \u81EA\u52A8\u5B9A\u4F4D\u5230\u89E6\u53D1\u5668\u6B63\u4E0A/\u4E0B/\u5DE6/\u53F3\u65B9\uFF0C\n * \u9ED8\u8BA4\u586B\u5145\u8272\u4E0E PopoverContent \u80CC\u666F\u8272\u4E00\u81F4\uFF08bg-primary-foreground\uFF09\uFF0C\u53EF\u901A\u8FC7 className \u8986\u76D6\u3002\n */\nconst PopoverArrow = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Arrow>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Arrow>\n>(({ className, width = 16, height = 8, ...props }, ref) => (\n <PopoverPrimitive.Arrow ref={ref} width={width} height={height} className={cn('fill-white', className)} {...props} />\n))\nPopoverArrow.displayName = PopoverPrimitive.Arrow.displayName\n\nexport { Popover, PopoverTrigger, PopoverAnchor, PopoverContent, PopoverClose, PopoverArrow }\n"],
|
|
5
|
+
"mappings": "aA6BM,mBAAAA,EAEI,OAAAC,EAFJ,QAAAC,MAAA,oBA3BN,UAAYC,MAAW,QACvB,UAAYC,MAAsB,0BAElC,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAAUF,EAAiB,KAE3BG,EAAiBH,EAAiB,QAElCI,EAAgBJ,EAAiB,OAEjCK,EAAeL,EAAiB,MAEhCM,EAAiBP,EAAM,WAS3B,CAAC,CAAE,UAAAQ,EAAW,MAAAC,EAAQ,SAAU,WAAAC,EAAa,EAAG,OAAAC,EAAQ,GAAGC,CAAM,EAAGC,IAAQ,CAC5E,MAAMC,EAAYd,EAAM,MAAM,EAE9B,OACEF,EAACG,EAAiB,OAAjB,CACC,SAAAF,EAAAF,EAAA,CACG,UAAAc,IAAW,QACVb,EAAC,SAAO,sEAA6DgB,CAAS,eAAeH,CAAM,eAAe,EAEpHb,EAACG,EAAiB,QAAjB,CACC,IAAKY,EACL,MAAOJ,EACP,WAAYC,EACZ,kBAAiBI,EACjB,UAAWZ,EACT,6aACAM,CACF,EACC,GAAGI,EACN,GACF,EACF,CAEJ,CAAC,EACDL,EAAe,YAAcN,EAAiB,QAAQ,YAQtD,MAAMc,EAAef,EAAM,WAGzB,CAAC,CAAE,UAAAQ,EAAW,MAAAQ,EAAQ,GAAI,OAAAC,EAAS,EAAG,GAAGL,CAAM,EAAGC,IAClDf,EAACG,EAAiB,MAAjB,CAAuB,IAAKY,EAAK,MAAOG,EAAO,OAAQC,EAAQ,UAAWf,EAAG,aAAcM,CAAS,EAAI,GAAGI,EAAO,CACpH,EACDG,EAAa,YAAcd,EAAiB,MAAM",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "React", "PopoverPrimitive", "cn", "Popover", "PopoverTrigger", "PopoverAnchor", "PopoverClose", "PopoverContent", "className", "align", "sideOffset", "zIndex", "props", "ref", "popoverId", "PopoverArrow", "width", "height"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const toastVariants: (props?: ({
|
|
4
|
+
variant?: "success" | "warning" | "countdown" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface ToastProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof toastVariants> {
|
|
7
|
+
open?: boolean;
|
|
8
|
+
message: string;
|
|
9
|
+
duration?: number;
|
|
10
|
+
seconds?: number;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
}
|
|
13
|
+
declare const Toast: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export interface UseToastOptions {
|
|
15
|
+
variant?: ToastProps['variant'];
|
|
16
|
+
message: string;
|
|
17
|
+
duration?: number;
|
|
18
|
+
seconds?: number;
|
|
19
|
+
}
|
|
20
|
+
declare function useToast(): {
|
|
21
|
+
toastProps: ToastProps;
|
|
22
|
+
showToast: (opts: UseToastOptions) => void;
|
|
23
|
+
};
|
|
24
|
+
export { Toast, toastVariants, useToast };
|
|
25
|
+
export default Toast;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as t,jsxs as c}from"react/jsx-runtime";import*as a from"react";import{cva as C}from"class-variance-authority";import{cn as b}from"../helpers/index.js";const h=C("bg-container-secondary-1 text-info-primary pointer-events-none fixed left-1/2 top-1/2 z-[9999] flex w-max -translate-x-1/2 select-none items-center gap-[4px] rounded-[8px] p-[16px] text-[18px] font-bold leading-[1.4] tracking-[-0.36px] drop-shadow-[0px_8px_12px_rgba(0,0,0,0.2)] transition-all duration-300 ease-in-out data-[state=closed]:-translate-y-2 data-[state=open]:translate-y-0 data-[state=closed]:opacity-0 data-[state=open]:opacity-100",{variants:{variant:{success:"",warning:"",countdown:""}},defaultVariants:{variant:"success"}}),L=()=>c("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[t("circle",{cx:"12",cy:"12",r:"10.5",className:"fill-success-0"}),t("g",{transform:"translate(6, 8)",children:t("path",{d:"M1 3.5L5 7L11 1",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),M=()=>c("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[t("circle",{cx:"12",cy:"12",r:"10.5",className:"fill-error-0"}),t("g",{transform:"translate(10.65, 6)",children:t("path",{d:"M1.35 9.28C2.1 9.28 2.7 9.88 2.7 10.63C2.7 11.37 2.1 11.98 1.35 11.98C0.6 11.98 0 11.37 0 10.63C0 9.88 0.6 9.28 1.35 9.28ZM1.35 0C1.97 0 2.47 0.5 2.47 1.13V7.13C2.47 7.75 1.97 8.25 1.35 8.25C0.73 8.25 0.22 7.75 0.22 7.13V1.13C0.22 0.5 0.73 0 1.35 0Z",fill:"white"})})]}),P=()=>c("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[t("circle",{cx:"12",cy:"12",r:"10.5",className:"fill-warning-0"}),t("g",{transform:"translate(8, 7)",children:t("path",{d:"M4 0V5L7 8",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),m=a.forwardRef(({className:l,variant:e,open:s=!1,message:n,duration:r=2500,seconds:o,onClose:i,...d},x)=>{const[u,g]=a.useState(!1),[p,w]=a.useState(o??0);if(a.useEffect(()=>{if(s)g(!0),e==="countdown"&&o!=null&&w(o);else{const f=setTimeout(()=>g(!1),300);return()=>clearTimeout(f)}},[s,e,o]),a.useEffect(()=>{if(!s||!u)return;if(e==="countdown"){if(p<=0){i?.();return}const k=setTimeout(()=>w(y=>y-1),1e3);return()=>clearTimeout(k)}const f=setTimeout(()=>i?.(),r);return()=>clearTimeout(f)},[s,u,e,r,p,i]),!u)return null;const v=e==="warning"?t(M,{}):e==="countdown"?t(P,{}):t(L,{}),T=e==="countdown"?n.replace(/\{seconds\}/g,String(p)):n;return c("div",{ref:x,className:b(h({variant:e}),l),"data-state":s?"open":"closed",role:"alert","aria-live":"assertive","aria-atomic":"true",...d,children:[v,t("span",{children:T})]})});m.displayName="Toast";function V(){const[l,e]=a.useState(!1),[s,n]=a.useState({message:""}),r=a.useCallback(d=>{n(d),e(!0)},[]),o=a.useCallback(()=>{e(!1)},[]);return{toastProps:{open:l,variant:s.variant,message:s.message,duration:s.duration,seconds:s.seconds,onClose:o},showToast:r}}var S=m;export{m as Toast,S as default,h as toastVariants,V as useToast};
|
|
2
|
+
//# sourceMappingURL=toast.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/toast.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../helpers/index.js'\n\nconst toastVariants = cva(\n 'bg-container-secondary-1 text-info-primary pointer-events-none fixed left-1/2 top-1/2 z-[9999] flex w-max -translate-x-1/2 select-none items-center gap-[4px] rounded-[8px] p-[16px] text-[18px] font-bold leading-[1.4] tracking-[-0.36px] drop-shadow-[0px_8px_12px_rgba(0,0,0,0.2)] transition-all duration-300 ease-in-out data-[state=closed]:-translate-y-2 data-[state=open]:translate-y-0 data-[state=closed]:opacity-0 data-[state=open]:opacity-100',\n {\n variants: {\n variant: {\n success: '',\n warning: '',\n countdown: '',\n },\n },\n defaultVariants: {\n variant: 'success',\n },\n }\n)\n\nconst CheckIcon = () => (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden>\n <circle cx=\"12\" cy=\"12\" r=\"10.5\" className=\"fill-success-0\" />\n <g transform=\"translate(6, 8)\">\n <path d=\"M1 3.5L5 7L11 1\" stroke=\"white\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </g>\n </svg>\n)\n\nconst WarningIcon = () => (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden>\n <circle cx=\"12\" cy=\"12\" r=\"10.5\" className=\"fill-error-0\" />\n <g transform=\"translate(10.65, 6)\">\n <path\n d=\"M1.35 9.28C2.1 9.28 2.7 9.88 2.7 10.63C2.7 11.37 2.1 11.98 1.35 11.98C0.6 11.98 0 11.37 0 10.63C0 9.88 0.6 9.28 1.35 9.28ZM1.35 0C1.97 0 2.47 0.5 2.47 1.13V7.13C2.47 7.75 1.97 8.25 1.35 8.25C0.73 8.25 0.22 7.75 0.22 7.13V1.13C0.22 0.5 0.73 0 1.35 0Z\"\n fill=\"white\"\n />\n </g>\n </svg>\n)\n\nconst ClockIcon = () => (\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden>\n <circle cx=\"12\" cy=\"12\" r=\"10.5\" className=\"fill-warning-0\" />\n <g transform=\"translate(8, 7)\">\n <path d=\"M4 0V5L7 8\" stroke=\"white\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </g>\n </svg>\n)\n\nexport interface ToastProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof toastVariants> {\n open?: boolean\n message: string\n duration?: number\n seconds?: number\n onClose?: () => void\n}\n\nconst Toast = React.forwardRef<HTMLDivElement, ToastProps>(\n ({ className, variant, open = false, message, duration = 2500, seconds, onClose, ...props }, ref) => {\n const [mounted, setMounted] = React.useState(false)\n const [remaining, setRemaining] = React.useState(seconds ?? 0)\n\n React.useEffect(() => {\n if (open) {\n setMounted(true)\n if (variant === 'countdown' && seconds != null) {\n setRemaining(seconds)\n }\n } else {\n const timer = setTimeout(() => setMounted(false), 300)\n return () => clearTimeout(timer)\n }\n }, [open, variant, seconds])\n\n React.useEffect(() => {\n if (!open || !mounted) return\n if (variant === 'countdown') {\n if (remaining <= 0) {\n onClose?.()\n return\n }\n const timer = setTimeout(() => setRemaining(r => r - 1), 1000)\n return () => clearTimeout(timer)\n }\n const timer = setTimeout(() => onClose?.(), duration)\n return () => clearTimeout(timer)\n }, [open, mounted, variant, duration, remaining, onClose])\n\n if (!mounted) return null\n\n const icon = variant === 'warning' ? <WarningIcon /> : variant === 'countdown' ? <ClockIcon /> : <CheckIcon />\n\n const displayMessage = variant === 'countdown' ? message.replace(/\\{seconds\\}/g, String(remaining)) : message\n\n return (\n <div\n ref={ref}\n className={cn(toastVariants({ variant }), className)}\n data-state={open ? 'open' : 'closed'}\n role=\"alert\"\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n {...props}\n >\n {icon}\n <span>{displayMessage}</span>\n </div>\n )\n }\n)\nToast.displayName = 'Toast'\n\nexport interface UseToastOptions {\n variant?: ToastProps['variant']\n message: string\n duration?: number\n seconds?: number\n}\n\nfunction useToast() {\n const [open, setOpen] = React.useState(false)\n const [options, setOptions] = React.useState<UseToastOptions>({ message: '' })\n\n const showToast = React.useCallback((opts: UseToastOptions) => {\n setOptions(opts)\n setOpen(true)\n }, [])\n\n const handleClose = React.useCallback(() => {\n setOpen(false)\n }, [])\n\n const toastProps: ToastProps = {\n open,\n variant: options.variant,\n message: options.message,\n duration: options.duration,\n seconds: options.seconds,\n onClose: handleClose,\n }\n\n return { toastProps, showToast }\n}\n\nexport { Toast, toastVariants, useToast }\nexport default Toast\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "cva", "cn", "toastVariants", "CheckIcon", "WarningIcon", "ClockIcon", "Toast", "className", "variant", "open", "message", "duration", "seconds", "onClose", "props", "ref", "mounted", "setMounted", "remaining", "setRemaining", "timer", "r", "icon", "displayMessage", "useToast", "setOpen", "options", "setOptions", "showToast", "opts", "handleClose", "toast_default"]
|
|
7
|
+
}
|
package/dist/tokens/base.css
CHANGED
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
--info-quaternary-color: #767880;
|
|
30
30
|
--info-white-color: #FFFFFF;
|
|
31
31
|
|
|
32
|
+
--stroke-primary-color: var(--brand-color-0);
|
|
33
|
+
|
|
32
34
|
--container-primary-color: #EAEAEC;
|
|
33
35
|
--container-secondary-color-0: #F5F6F7;
|
|
34
36
|
--container-secondary-color-1: #ffffff;
|
|
@@ -90,6 +92,8 @@
|
|
|
90
92
|
--info-quaternary-color: #75787F;
|
|
91
93
|
--info-white-color: #1E2024;
|
|
92
94
|
|
|
95
|
+
--stroke-primary-color: var(--brand-color-0);
|
|
96
|
+
|
|
93
97
|
--container-primary-color: #1E2024;
|
|
94
98
|
--container-secondary-color-0: #373A40;
|
|
95
99
|
--container-secondary-color-1: #F5F6F7;
|