asheeui 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -166
- package/dist/components/alert/Alert.d.ts.map +1 -1
- package/dist/components/alert/Alert.js +6 -6
- package/dist/components/auth-layout/AuthLayout.d.ts +79 -0
- package/dist/components/auth-layout/AuthLayout.d.ts.map +1 -0
- package/dist/components/auth-layout/AuthLayout.js +54 -0
- package/dist/components/auth-layout/auth-layout-config.d.ts +41 -0
- package/dist/components/auth-layout/auth-layout-config.d.ts.map +1 -0
- package/dist/components/auth-layout/auth-layout-config.js +18 -0
- package/dist/components/auth-layout/auth-layout-styles.d.ts +25 -0
- package/dist/components/auth-layout/auth-layout-styles.d.ts.map +1 -0
- package/dist/components/auth-layout/auth-layout-styles.js +11 -0
- package/dist/components/auth-layout/index.d.ts +3 -0
- package/dist/components/auth-layout/index.d.ts.map +1 -0
- package/dist/components/auth-layout/index.js +3 -0
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.d.ts.map +1 -1
- package/dist/components/avatar/Avatar.js +7 -7
- package/dist/components/badge/Badge.d.ts.map +1 -1
- package/dist/components/badge/Badge.js +3 -3
- package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +6 -6
- package/dist/components/calendar/Calendar.d.ts.map +1 -1
- package/dist/components/calendar/Calendar.js +4 -4
- package/dist/components/calendar/DateGrid.d.ts.map +1 -1
- package/dist/components/calendar/DateGrid.js +87 -87
- package/dist/components/clipboard/Clipboard.d.ts +75 -0
- package/dist/components/clipboard/Clipboard.d.ts.map +1 -0
- package/dist/components/clipboard/Clipboard.js +53 -0
- package/dist/components/clipboard/CopyButton.d.ts +64 -0
- package/dist/components/clipboard/CopyButton.d.ts.map +1 -0
- package/dist/components/clipboard/CopyButton.js +44 -0
- package/dist/components/clipboard/clipboard-config.d.ts +42 -0
- package/dist/components/clipboard/clipboard-config.d.ts.map +1 -0
- package/dist/components/clipboard/clipboard-config.js +23 -0
- package/dist/components/clipboard/clipboard-styles.d.ts +11 -0
- package/dist/components/clipboard/clipboard-styles.d.ts.map +1 -0
- package/dist/components/clipboard/clipboard-styles.js +5 -0
- package/dist/components/clipboard/index.d.ts +4 -0
- package/dist/components/clipboard/index.d.ts.map +1 -0
- package/dist/components/clipboard/index.js +4 -0
- package/dist/components/container/Container.d.ts +51 -0
- package/dist/components/container/Container.d.ts.map +1 -0
- package/dist/components/container/Container.js +21 -0
- package/dist/components/container/container-config.d.ts +61 -0
- package/dist/components/container/container-config.d.ts.map +1 -0
- package/dist/components/container/container-config.js +16 -0
- package/dist/components/container/container-styles.d.ts +18 -0
- package/dist/components/container/container-styles.d.ts.map +1 -0
- package/dist/components/container/container-styles.js +12 -0
- package/dist/components/container/index.d.ts +3 -0
- package/dist/components/container/index.d.ts.map +1 -0
- package/dist/components/container/index.js +3 -0
- package/dist/components/cta/CTA.d.ts +81 -0
- package/dist/components/cta/CTA.d.ts.map +1 -0
- package/dist/components/cta/CTA.js +60 -0
- package/dist/components/cta/cta-config.d.ts +69 -0
- package/dist/components/cta/cta-config.d.ts.map +1 -0
- package/dist/components/cta/cta-config.js +22 -0
- package/dist/components/cta/cta-styles.d.ts +8 -0
- package/dist/components/cta/cta-styles.d.ts.map +1 -0
- package/dist/components/cta/cta-styles.js +9 -0
- package/dist/components/cta/index.d.ts +3 -0
- package/dist/components/cta/index.d.ts.map +1 -0
- package/dist/components/cta/index.js +3 -0
- package/dist/components/dropmenu/Dropmenu.d.ts.map +1 -1
- package/dist/components/empty-state/EmptyState.d.ts +77 -0
- package/dist/components/empty-state/EmptyState.d.ts.map +1 -0
- package/dist/components/empty-state/EmptyState.js +46 -0
- package/dist/components/empty-state/empty-state-config.d.ts +44 -0
- package/dist/components/empty-state/empty-state-config.d.ts.map +1 -0
- package/dist/components/empty-state/empty-state-config.js +16 -0
- package/dist/components/empty-state/empty-state-styles.d.ts +13 -0
- package/dist/components/empty-state/empty-state-styles.d.ts.map +1 -0
- package/dist/components/empty-state/empty-state-styles.js +18 -0
- package/dist/components/empty-state/index.d.ts +3 -0
- package/dist/components/empty-state/index.d.ts.map +1 -0
- package/dist/components/empty-state/index.js +3 -0
- package/dist/components/feature-grid/FeatureGrid.d.ts +107 -0
- package/dist/components/feature-grid/FeatureGrid.d.ts.map +1 -0
- package/dist/components/feature-grid/FeatureGrid.js +94 -0
- package/dist/components/feature-grid/feature-grid-config.d.ts +80 -0
- package/dist/components/feature-grid/feature-grid-config.d.ts.map +1 -0
- package/dist/components/feature-grid/feature-grid-config.js +28 -0
- package/dist/components/feature-grid/feature-grid-styles.d.ts +11 -0
- package/dist/components/feature-grid/feature-grid-styles.d.ts.map +1 -0
- package/dist/components/feature-grid/feature-grid-styles.js +5 -0
- package/dist/components/feature-grid/index.d.ts +3 -0
- package/dist/components/feature-grid/index.d.ts.map +1 -0
- package/dist/components/feature-grid/index.js +3 -0
- package/dist/components/footer/Footer.d.ts +73 -0
- package/dist/components/footer/Footer.d.ts.map +1 -0
- package/dist/components/footer/Footer.js +112 -0
- package/dist/components/footer/footer-config.d.ts +40 -0
- package/dist/components/footer/footer-config.d.ts.map +1 -0
- package/dist/components/footer/footer-config.js +18 -0
- package/dist/components/footer/footer-styles.d.ts +22 -0
- package/dist/components/footer/footer-styles.d.ts.map +1 -0
- package/dist/components/footer/footer-styles.js +9 -0
- package/dist/components/footer/index.d.ts +3 -0
- package/dist/components/footer/index.d.ts.map +1 -0
- package/dist/components/footer/index.js +3 -0
- package/dist/components/form/Form.d.ts.map +1 -1
- package/dist/components/grid/Grid.d.ts +71 -0
- package/dist/components/grid/Grid.d.ts.map +1 -0
- package/dist/components/grid/Grid.js +23 -0
- package/dist/components/grid/grid-config.d.ts +63 -0
- package/dist/components/grid/grid-config.d.ts.map +1 -0
- package/dist/components/grid/grid-config.js +16 -0
- package/dist/components/grid/grid-styles.d.ts +12 -0
- package/dist/components/grid/grid-styles.d.ts.map +1 -0
- package/dist/components/grid/grid-styles.js +31 -0
- package/dist/components/grid/index.d.ts +3 -0
- package/dist/components/grid/index.d.ts.map +1 -0
- package/dist/components/grid/index.js +3 -0
- package/dist/components/hero/Hero.d.ts +90 -0
- package/dist/components/hero/Hero.d.ts.map +1 -0
- package/dist/components/hero/Hero.js +63 -0
- package/dist/components/hero/hero-config.d.ts +71 -0
- package/dist/components/hero/hero-config.d.ts.map +1 -0
- package/dist/components/hero/hero-config.js +22 -0
- package/dist/components/hero/hero-styles.d.ts +19 -0
- package/dist/components/hero/hero-styles.d.ts.map +1 -0
- package/dist/components/hero/hero-styles.js +5 -0
- package/dist/components/hero/index.d.ts +3 -0
- package/dist/components/hero/index.d.ts.map +1 -0
- package/dist/components/hero/index.js +3 -0
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/navbar/Navbar.d.ts +87 -0
- package/dist/components/navbar/Navbar.d.ts.map +1 -0
- package/dist/components/navbar/Navbar.js +117 -0
- package/dist/components/navbar/index.d.ts +3 -0
- package/dist/components/navbar/index.d.ts.map +1 -0
- package/dist/components/navbar/index.js +3 -0
- package/dist/components/navbar/navbar-config.d.ts +52 -0
- package/dist/components/navbar/navbar-config.d.ts.map +1 -0
- package/dist/components/navbar/navbar-config.js +20 -0
- package/dist/components/navbar/navbar-styles.d.ts +28 -0
- package/dist/components/navbar/navbar-styles.d.ts.map +1 -0
- package/dist/components/navbar/navbar-styles.js +9 -0
- package/dist/components/page/Page.d.ts +166 -0
- package/dist/components/page/Page.d.ts.map +1 -0
- package/dist/components/page/Page.js +90 -0
- package/dist/components/page/index.d.ts +3 -0
- package/dist/components/page/index.d.ts.map +1 -0
- package/dist/components/page/index.js +3 -0
- package/dist/components/page/page-config.d.ts +57 -0
- package/dist/components/page/page-config.d.ts.map +1 -0
- package/dist/components/page/page-config.js +20 -0
- package/dist/components/page/page-styles.d.ts +25 -0
- package/dist/components/page/page-styles.d.ts.map +1 -0
- package/dist/components/page/page-styles.js +5 -0
- package/dist/components/pagination/Pagination.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.js +8 -8
- package/dist/components/pin-input/PinInput.d.ts +109 -0
- package/dist/components/pin-input/PinInput.d.ts.map +1 -0
- package/dist/components/pin-input/PinInput.js +124 -0
- package/dist/components/pin-input/index.d.ts +3 -0
- package/dist/components/pin-input/index.d.ts.map +1 -0
- package/dist/components/pin-input/index.js +3 -0
- package/dist/components/pin-input/pin-input-config.d.ts +82 -0
- package/dist/components/pin-input/pin-input-config.d.ts.map +1 -0
- package/dist/components/pin-input/pin-input-config.js +23 -0
- package/dist/components/pin-input/pin-input-styles.d.ts +16 -0
- package/dist/components/pin-input/pin-input-styles.d.ts.map +1 -0
- package/dist/components/pin-input/pin-input-styles.js +9 -0
- package/dist/components/pricing-card/PricingCard.d.ts +87 -0
- package/dist/components/pricing-card/PricingCard.d.ts.map +1 -0
- package/dist/components/pricing-card/PricingCard.js +79 -0
- package/dist/components/pricing-card/index.d.ts +3 -0
- package/dist/components/pricing-card/index.d.ts.map +1 -0
- package/dist/components/pricing-card/index.js +3 -0
- package/dist/components/pricing-card/pricing-card-config.d.ts +35 -0
- package/dist/components/pricing-card/pricing-card-config.d.ts.map +1 -0
- package/dist/components/pricing-card/pricing-card-config.js +16 -0
- package/dist/components/pricing-card/pricing-card-styles.d.ts +21 -0
- package/dist/components/pricing-card/pricing-card-styles.d.ts.map +1 -0
- package/dist/components/pricing-card/pricing-card-styles.js +5 -0
- package/dist/components/radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/section/Section.d.ts +56 -0
- package/dist/components/section/Section.d.ts.map +1 -0
- package/dist/components/section/Section.js +27 -0
- package/dist/components/section/index.d.ts +3 -0
- package/dist/components/section/index.d.ts.map +1 -0
- package/dist/components/section/index.js +3 -0
- package/dist/components/section/section-config.d.ts +64 -0
- package/dist/components/section/section-config.d.ts.map +1 -0
- package/dist/components/section/section-config.js +20 -0
- package/dist/components/section/section-styles.d.ts +8 -0
- package/dist/components/section/section-styles.d.ts.map +1 -0
- package/dist/components/section/section-styles.js +9 -0
- package/dist/components/section-kit/ActionGroup.d.ts +47 -0
- package/dist/components/section-kit/ActionGroup.d.ts.map +1 -0
- package/dist/components/section-kit/ActionGroup.js +35 -0
- package/dist/components/section-kit/SectionHeading.d.ts +65 -0
- package/dist/components/section-kit/SectionHeading.d.ts.map +1 -0
- package/dist/components/section-kit/SectionHeading.js +34 -0
- package/dist/components/section-kit/index.d.ts +12 -0
- package/dist/components/section-kit/index.d.ts.map +1 -0
- package/dist/components/section-kit/index.js +2 -0
- package/dist/components/sidebar-layout/SidebarLayout.d.ts +67 -0
- package/dist/components/sidebar-layout/SidebarLayout.d.ts.map +1 -0
- package/dist/components/sidebar-layout/SidebarLayout.js +40 -0
- package/dist/components/sidebar-layout/index.d.ts +3 -0
- package/dist/components/sidebar-layout/index.d.ts.map +1 -0
- package/dist/components/sidebar-layout/index.js +3 -0
- package/dist/components/sidebar-layout/sidebar-layout-config.d.ts +49 -0
- package/dist/components/sidebar-layout/sidebar-layout-config.d.ts.map +1 -0
- package/dist/components/sidebar-layout/sidebar-layout-config.js +16 -0
- package/dist/components/sidebar-layout/sidebar-layout-styles.d.ts +21 -0
- package/dist/components/sidebar-layout/sidebar-layout-styles.d.ts.map +1 -0
- package/dist/components/sidebar-layout/sidebar-layout-styles.js +9 -0
- package/dist/components/skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/stack/Stack.d.ts +107 -0
- package/dist/components/stack/Stack.d.ts.map +1 -0
- package/dist/components/stack/Stack.js +36 -0
- package/dist/components/stack/index.d.ts +3 -0
- package/dist/components/stack/index.d.ts.map +1 -0
- package/dist/components/stack/index.js +3 -0
- package/dist/components/stack/stack-config.d.ts +68 -0
- package/dist/components/stack/stack-config.d.ts.map +1 -0
- package/dist/components/stack/stack-config.js +20 -0
- package/dist/components/stack/stack-styles.d.ts +10 -0
- package/dist/components/stack/stack-styles.d.ts.map +1 -0
- package/dist/components/stack/stack-styles.js +21 -0
- package/dist/components/testimonials/Testimonials.d.ts +78 -0
- package/dist/components/testimonials/Testimonials.d.ts.map +1 -0
- package/dist/components/testimonials/Testimonials.js +96 -0
- package/dist/components/testimonials/index.d.ts +3 -0
- package/dist/components/testimonials/index.d.ts.map +1 -0
- package/dist/components/testimonials/index.js +3 -0
- package/dist/components/testimonials/testimonials-config.d.ts +44 -0
- package/dist/components/testimonials/testimonials-config.d.ts.map +1 -0
- package/dist/components/testimonials/testimonials-config.js +28 -0
- package/dist/components/testimonials/testimonials-styles.d.ts +11 -0
- package/dist/components/testimonials/testimonials-styles.d.ts.map +1 -0
- package/dist/components/testimonials/testimonials-styles.js +5 -0
- package/dist/components/typography/typography-styles.d.ts.map +1 -1
- package/dist/config/validate-config.d.ts.map +1 -1
- package/dist/icons/CopyIcon.d.ts +3 -0
- package/dist/icons/CopyIcon.d.ts.map +1 -0
- package/dist/icons/CopyIcon.js +24 -0
- package/dist/index.d.ts +19 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +107 -72
- package/dist/puck/adapters.d.ts +41 -0
- package/dist/puck/adapters.d.ts.map +1 -0
- package/dist/puck/adapters.js +30 -0
- package/dist/puck/blocks/content.d.ts +32 -0
- package/dist/puck/blocks/content.d.ts.map +1 -0
- package/dist/puck/blocks/content.js +54 -0
- package/dist/puck/blocks/layout.d.ts +44 -0
- package/dist/puck/blocks/layout.d.ts.map +1 -0
- package/dist/puck/blocks/layout.js +69 -0
- package/dist/puck/blocks/navigation.d.ts +66 -0
- package/dist/puck/blocks/navigation.d.ts.map +1 -0
- package/dist/puck/blocks/navigation.js +122 -0
- package/dist/puck/blocks/sections.d.ts +134 -0
- package/dist/puck/blocks/sections.d.ts.map +1 -0
- package/dist/puck/blocks/sections.js +232 -0
- package/dist/puck/blocks/utility.d.ts +22 -0
- package/dist/puck/blocks/utility.d.ts.map +1 -0
- package/dist/puck/blocks/utility.js +49 -0
- package/dist/puck/config.d.ts +63 -0
- package/dist/puck/config.d.ts.map +1 -0
- package/dist/puck/config.js +79 -0
- package/dist/puck/fields.d.ts +94 -0
- package/dist/puck/fields.d.ts.map +1 -0
- package/dist/puck/fields.js +116 -0
- package/dist/puck/index.d.ts +21 -0
- package/dist/puck/index.d.ts.map +1 -0
- package/dist/puck/index.js +10 -0
- package/dist/shared/action.d.ts +52 -0
- package/dist/shared/action.d.ts.map +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/spacing.d.ts +38 -0
- package/dist/shared/spacing.d.ts.map +1 -0
- package/dist/shared/spacing.js +29 -0
- package/dist/shared/typography.d.ts.map +1 -1
- package/dist/utils/resolve-token.d.ts +32 -7
- package/dist/utils/resolve-token.d.ts.map +1 -1
- package/dist/utils/resolve-token.js +9 -1
- package/package.json +14 -2
|
@@ -5,13 +5,13 @@ import { RADIUS_CLASS as t } from "../../shared/radius.js";
|
|
|
5
5
|
import { resolveVariantClass as n } from "../../shared/variant.js";
|
|
6
6
|
import { useAsheeConfig as r } from "../../libs/context.js";
|
|
7
7
|
import { resolveCascade as i, resolveClassKey as a, resolveRadiusKey as o } from "../../utils/resolve-token.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { FALLBACK_BADGE_CONFIG as s } from "./badge-config.js";
|
|
9
|
+
import { BADGE_FONT_CLASS as c, BADGE_GAP_CLASS as l, BADGE_HEIGHT_CLASS as u, BADGE_ICON_SIZE_CLASS as d, BADGE_PADDING_CLASS as f } from "./badge-styles.js";
|
|
10
10
|
import { forwardRef as p } from "react";
|
|
11
11
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
12
|
//#region src/components/badge/Badge.tsx
|
|
13
13
|
var _ = p(({ variant: p, color: _, size: v, radius: y, label: b, children: x, startContent: S, endContent: C, className: w, ...T }, E) => {
|
|
14
|
-
let D = r(), O = D.components?.badge, k = i(p, O?.variant, D.defaultVariant,
|
|
14
|
+
let D = r(), O = D.components?.badge, k = i(p, O?.variant, D.defaultVariant, s.variant), A = k === "underlined" ? "bordered" : k, j = i(_, O?.color, D.defaultColor, s.color), M = i(v, O?.size, void 0, s.size), N = o(y, O?.radius, D.defaultRadius, s.radius), P = a(M, u, s.size), F = a(M, f, s.size), I = a(M, c, s.size), L = a(M, l, s.size), R = a(M, d, s.size), z = a(N, t, s.radius);
|
|
15
15
|
return /* @__PURE__ */ h("span", {
|
|
16
16
|
ref: E,
|
|
17
17
|
className: e("inline-flex items-center justify-center shrink-0 whitespace-nowrap font-medium select-none", P, F, I, L, R, z, n(A, j), w),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAOf,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,qBAAqB,CAAC;AAU7B;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED,KAAK,mBAAmB,GAAG,gBAAgB,GACzC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D;;OAEG;IACH,KAAK,EAAE,cAAc,EAAE,CAAC;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,UAAU,yGAmHtB,CAAC"}
|
|
@@ -5,20 +5,20 @@ import { useAsheeConfig as t } from "../../libs/context.js";
|
|
|
5
5
|
import { resolveCascade as n, resolveClassKey as r } from "../../utils/resolve-token.js";
|
|
6
6
|
import { ChevronRightIcon as i } from "../../icons/ChevronRightIcon.js";
|
|
7
7
|
import { Link as a } from "../link/Link.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { FALLBACK_BREADCRUMB_CONFIG as o } from "./breadcrumb-config.js";
|
|
9
|
+
import { BREADCRUMB_BASE_CLASS as s, BREADCRUMB_CURRENT_CLASS as c, BREADCRUMB_FONT_CLASS as l, BREADCRUMB_GAP_CLASS as u, BREADCRUMB_LIST_CLASS as d, BREADCRUMB_SEPARATOR_ICON_CLASS as f } from "./breadcrumb-styles.js";
|
|
10
10
|
import { forwardRef as p } from "react";
|
|
11
11
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
12
|
//#region src/components/breadcrumb/Breadcrumb.tsx
|
|
13
13
|
var g = p(({ items: p, separator: g, label: _ = "Breadcrumb", size: v, color: y, className: b, ...x }, S) => {
|
|
14
|
-
let C = t(), w = C.components?.breadcrumb, T = n(v, w?.size, void 0,
|
|
14
|
+
let C = t(), w = C.components?.breadcrumb, T = n(v, w?.size, void 0, o.size), E = n(y, w?.color, C.defaultColor, o.color), D = r(T, l, o.size), O = r(T, u, o.size), k = r(T, f, o.size), A = g ?? /* @__PURE__ */ m(i, { "aria-hidden": "true" }), j = p.some((e) => e.isCurrent);
|
|
15
15
|
return /* @__PURE__ */ m("nav", {
|
|
16
16
|
ref: S,
|
|
17
17
|
"aria-label": _,
|
|
18
|
-
className: e(
|
|
18
|
+
className: e(s, D, b),
|
|
19
19
|
...x,
|
|
20
20
|
children: /* @__PURE__ */ m("ol", {
|
|
21
|
-
className: e(
|
|
21
|
+
className: e(d, O),
|
|
22
22
|
children: p.map((t, n) => {
|
|
23
23
|
let r = t.isCurrent ?? (!j && n === p.length - 1);
|
|
24
24
|
return /* @__PURE__ */ h("li", {
|
|
@@ -29,7 +29,7 @@ var g = p(({ items: p, separator: g, label: _ = "Breadcrumb", size: v, color: y,
|
|
|
29
29
|
children: A
|
|
30
30
|
}), r || !t.href ? /* @__PURE__ */ h("span", {
|
|
31
31
|
"aria-current": r ? "page" : void 0,
|
|
32
|
-
className:
|
|
32
|
+
className: c,
|
|
33
33
|
children: [t.icon, t.label]
|
|
34
34
|
}) : /* @__PURE__ */ m(a, {
|
|
35
35
|
href: t.href,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/Calendar.tsx"],"names":[],"mappings":"AA+BA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/Calendar.tsx"],"names":[],"mappings":"AA+BA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQxD,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,oBAAoB,EAE1B,MAAM,mBAAmB,CAAC;AAG3B;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,GAC5D,IAAI,CACF,UAAU,EACV,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,YAAY,GAAG,cAAc,CACtE,CAAC;AAEJ;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD;;;OAGG;IACH,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAEvC;;;OAGG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAE7B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,eAAO,MAAM,QAAQ,4GA+VpB,CAAC"}
|
|
@@ -12,14 +12,14 @@ import { CalendarIcon as u } from "../../icons/CalendarIcon.js";
|
|
|
12
12
|
import { ClearIcon as d } from "../../icons/ClearIcon.js";
|
|
13
13
|
import { ClockIcon as ee } from "../../icons/ClockIcon.js";
|
|
14
14
|
import { formatDisplay as f, getDefaultPlaceholder as p, getNewCursorPosition as m, parseDateString as h } from "./calendar.helpers.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { FALLBACK_DATE_PICKER_CONFIG as g } from "./calendar-config.js";
|
|
16
|
+
import { DateGrid as _ } from "./DateGrid.js";
|
|
17
17
|
import { forwardRef as v, useCallback as y, useEffect as b, useId as x, useRef as S, useState as C } from "react";
|
|
18
18
|
import { Fragment as te, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
19
19
|
import { FloatingFocusManager as E, FloatingPortal as D } from "@floating-ui/react";
|
|
20
20
|
//#region src/components/calendar/Calendar.tsx
|
|
21
21
|
var O = v(({ selected: v, onChange: O, mode: k, isClearable: A = !1, disableFuture: j = !1, placeholder: ne, size: M, radius: N, color: P, disabled: F, picker: I, ...L }, R) => {
|
|
22
|
-
let z = r(), B = z.components?.calendar, V = x(), H = L.id ?? V, [U, W] = C(!1), [G, K] = C(""), q = S(null), J = i(k, B?.mode, void 0,
|
|
22
|
+
let z = r(), B = z.components?.calendar, V = x(), H = L.id ?? V, [U, W] = C(!1), [G, K] = C(""), q = S(null), J = i(k, B?.mode, void 0, g.mode), Y = i(I?.portal, B?.picker?.portal, void 0, c.portal), re = i(I?.portalTarget, B?.picker?.portalTarget, void 0, null), X = i(I?.lockScroll, B?.picker?.lockScroll, void 0, !0), ie = i(M, B?.size, void 0, g.size), ae = i(P, B?.color, z.defaultColor, g.color), Z = o(typeof N == "string" ? N : void 0, typeof B?.radius == "string" ? B.radius : void 0, z.defaultRadius, g.radius), oe = a(Z === "full" ? "xl" : Z, n, g.radius), { refs: Q, context: se, floatingStyles: ce, isPositioned: le, getReferenceProps: ue, getFloatingProps: de } = l({
|
|
23
23
|
isOpen: U,
|
|
24
24
|
onOpenChange: W,
|
|
25
25
|
disabled: F,
|
|
@@ -80,7 +80,7 @@ var O = v(({ selected: v, onChange: O, mode: k, isClearable: A = !1, disableFutu
|
|
|
80
80
|
style: { ...ce },
|
|
81
81
|
className: e("outline-none w-max", "transition-none", le ? "animate-in fade-in-0 zoom-in-95 duration-150 ease-out" : "invisible opacity-0 pointer-events-none", I?.className),
|
|
82
82
|
...de(),
|
|
83
|
-
children: /* @__PURE__ */ w(
|
|
83
|
+
children: /* @__PURE__ */ w(_, {
|
|
84
84
|
selected: v,
|
|
85
85
|
mode: J,
|
|
86
86
|
isClearable: A,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateGrid.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/DateGrid.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAStD,UAAU,aAAa;IACrB;;;OAGG;IACH,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC;;;OAGG;IACH,IAAI,EAAE,YAAY,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,eAAe,EAAE,YAAY,CAAC;IAC9B;;;OAGG;IACH,aAAa,EAAE,KAAK,CAAC;IACrB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IACtC;;;OAGG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,wJAUlB,aAAa,
|
|
1
|
+
{"version":3,"file":"DateGrid.d.ts","sourceRoot":"","sources":["../../../src/components/calendar/DateGrid.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAStD,UAAU,aAAa;IACrB;;;OAGG;IACH,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC;;;OAGG;IACH,IAAI,EAAE,YAAY,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,eAAe,EAAE,YAAY,CAAC;IAC9B;;;OAGG;IACH,aAAa,EAAE,KAAK,CAAC;IACrB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IACtC;;;OAGG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,wJAUlB,aAAa,iCAyYd,CAAC"}
|
|
@@ -1,194 +1,194 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../utils/cn.js";
|
|
3
3
|
import { ChevronRightIcon as t } from "../../icons/ChevronRightIcon.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { CALENDAR_COLOR_CLASSES as
|
|
7
|
-
import { TimeSpinner as
|
|
8
|
-
import { memo as
|
|
9
|
-
import { jsx as
|
|
4
|
+
import { DAYS_OF_WEEK as n, MONTHS as r, buildDayCells as ee } from "./calendar.helpers.js";
|
|
5
|
+
import { ChevronLeftIcon as i } from "../../icons/ChevronLeftIcon.js";
|
|
6
|
+
import { CALENDAR_COLOR_CLASSES as a, DATE_PICKER_CELL_SIZE_CLASS as o } from "./calendar-styles.js";
|
|
7
|
+
import { TimeSpinner as s } from "./TimeSpinner.js";
|
|
8
|
+
import { memo as c, useCallback as te, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
9
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/calendar/DateGrid.tsx
|
|
11
|
-
var
|
|
12
|
-
let
|
|
13
|
-
|
|
11
|
+
var h = c(function({ selected: c, mode: h, isClearable: g, resolvedSizeKey: _, resolvedColor: v, radiusClass: y, onSelect: b, onClose: x, disableFuture: S = !1 }) {
|
|
12
|
+
let C = /* @__PURE__ */ new Date(), [w, T] = f(c?.getFullYear() ?? C.getFullYear()), [E, D] = f(c?.getMonth() ?? C.getMonth()), [O, ne] = f(c?.getHours() ?? 0), [k, A] = f(c?.getMinutes() ?? 0), [j, M] = f(c?.getSeconds() ?? 0), [N, P] = f(() => c ?? C), F = d({}), I = d(!1), L = (e) => `${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`, R = te((e) => {
|
|
13
|
+
P((t) => {
|
|
14
14
|
let n = new Date(t.getFullYear(), t.getMonth(), t.getDate() + e);
|
|
15
|
-
return
|
|
15
|
+
return T(n.getFullYear()), D(n.getMonth()), I.current = !0, n;
|
|
16
16
|
});
|
|
17
17
|
}, []);
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
l(() => {
|
|
19
|
+
I.current && (I.current = !1, F.current[L(N)]?.focus());
|
|
20
20
|
});
|
|
21
|
-
function
|
|
21
|
+
function z(e) {
|
|
22
22
|
switch (e.key) {
|
|
23
23
|
case "ArrowLeft":
|
|
24
|
-
e.preventDefault(),
|
|
24
|
+
e.preventDefault(), R(-1);
|
|
25
25
|
return;
|
|
26
26
|
case "ArrowRight":
|
|
27
|
-
e.preventDefault(),
|
|
27
|
+
e.preventDefault(), R(1);
|
|
28
28
|
return;
|
|
29
29
|
case "ArrowUp":
|
|
30
|
-
e.preventDefault(),
|
|
30
|
+
e.preventDefault(), R(-7);
|
|
31
31
|
return;
|
|
32
32
|
case "ArrowDown":
|
|
33
|
-
e.preventDefault(),
|
|
33
|
+
e.preventDefault(), R(7);
|
|
34
34
|
return;
|
|
35
35
|
case "PageUp":
|
|
36
|
-
e.preventDefault(),
|
|
36
|
+
e.preventDefault(), R(-30);
|
|
37
37
|
return;
|
|
38
38
|
case "PageDown":
|
|
39
|
-
e.preventDefault(),
|
|
39
|
+
e.preventDefault(), R(30);
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
let
|
|
44
|
-
function
|
|
45
|
-
let r =
|
|
46
|
-
|
|
43
|
+
let B = a[v] ?? a.primary;
|
|
44
|
+
function V(e, t, n) {
|
|
45
|
+
let r = c ?? /* @__PURE__ */ new Date();
|
|
46
|
+
b(new Date(r.getFullYear(), r.getMonth(), r.getDate(), e, t, n, 0));
|
|
47
|
+
}
|
|
48
|
+
function H(e) {
|
|
49
|
+
ne(e), V(e, k, j);
|
|
47
50
|
}
|
|
48
51
|
function U(e) {
|
|
49
|
-
|
|
52
|
+
A(e), V(O, e, j);
|
|
50
53
|
}
|
|
51
54
|
function W(e) {
|
|
52
|
-
|
|
55
|
+
M(e), V(O, k, e);
|
|
53
56
|
}
|
|
54
57
|
function G(e) {
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
function K(e) {
|
|
58
|
-
S(new Date(E, O, e, A, j, M, 0)), _ === "date" && C();
|
|
58
|
+
b(new Date(w, E, e, O, k, j, 0)), h === "date" && x();
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
60
|
+
function K() {
|
|
61
|
+
E === 0 ? (D(11), T((e) => e - 1)) : D((e) => e - 1);
|
|
62
62
|
}
|
|
63
63
|
function re() {
|
|
64
|
-
|
|
64
|
+
E === 11 ? (D(0), T((e) => e + 1)) : D((e) => e + 1);
|
|
65
65
|
}
|
|
66
66
|
function q(e) {
|
|
67
|
-
return !!
|
|
67
|
+
return !!c && c.getFullYear() === w && c.getMonth() === E && c.getDate() === e;
|
|
68
68
|
}
|
|
69
69
|
function J(e) {
|
|
70
|
-
return
|
|
70
|
+
return C.getFullYear() === w && C.getMonth() === E && C.getDate() === e;
|
|
71
71
|
}
|
|
72
|
-
let ie = new Date(
|
|
72
|
+
let ie = new Date(C.getFullYear(), C.getMonth(), C.getDate());
|
|
73
73
|
function Y(e) {
|
|
74
|
-
return
|
|
74
|
+
return S ? new Date(w, E, e) > ie : !1;
|
|
75
75
|
}
|
|
76
|
-
let X = !
|
|
76
|
+
let X = !S || w < C.getFullYear() || w === C.getFullYear() && E < C.getMonth(), Z = h === "date" || h === "datetime", ae = h === "time" || h === "datetime", oe = h !== "date" || g && !!c, Q = ee(w, E), $ = u(() => Q.map((e, t) => ({
|
|
77
77
|
key: e === null ? `empty-slot-${t}` : `day-${e}`,
|
|
78
78
|
day: e
|
|
79
|
-
})), [Q]), se =
|
|
79
|
+
})), [Q]), se = u(() => {
|
|
80
80
|
let e = [];
|
|
81
81
|
for (let t = 0; t < $.length; t += 7) e.push($.slice(t, t + 7));
|
|
82
82
|
return e;
|
|
83
83
|
}, [$]);
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
className: e("bg-background border border-border/70 shadow-xl select-none p-4 w-max",
|
|
86
|
-
children: [/* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ m("div", {
|
|
85
|
+
className: e("bg-background border border-border/70 shadow-xl select-none p-4 w-max", y),
|
|
86
|
+
children: [/* @__PURE__ */ m("div", {
|
|
87
87
|
className: "flex flex-row",
|
|
88
|
-
children: [Z && /* @__PURE__ */
|
|
88
|
+
children: [Z && /* @__PURE__ */ m("div", {
|
|
89
89
|
className: "flex flex-col w-[264px]",
|
|
90
|
-
children: [/* @__PURE__ */
|
|
90
|
+
children: [/* @__PURE__ */ m("div", {
|
|
91
91
|
className: "flex items-center justify-between pb-3 mb-2 border-b border-border/60",
|
|
92
92
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ p("button", {
|
|
94
94
|
type: "button",
|
|
95
|
-
onClick:
|
|
95
|
+
onClick: K,
|
|
96
96
|
"aria-label": "Previous month",
|
|
97
|
-
className: e("p-1.5 text-foreground/70 transition-all active:scale-95", "hover:text-foreground hover:bg-secondary",
|
|
98
|
-
children: /* @__PURE__ */
|
|
97
|
+
className: e("p-1.5 text-foreground/70 transition-all active:scale-95", "hover:text-foreground hover:bg-secondary", y),
|
|
98
|
+
children: /* @__PURE__ */ p(i, {})
|
|
99
99
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ m("span", {
|
|
101
101
|
className: "font-semibold text-sm text-foreground tracking-wide",
|
|
102
102
|
children: [
|
|
103
|
-
|
|
103
|
+
r[E],
|
|
104
104
|
" ",
|
|
105
|
-
|
|
105
|
+
w
|
|
106
106
|
]
|
|
107
107
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ p("button", {
|
|
109
109
|
type: "button",
|
|
110
110
|
onClick: re,
|
|
111
111
|
disabled: !X,
|
|
112
112
|
"aria-label": "Next month",
|
|
113
|
-
className: e("p-1.5 text-foreground/70 transition-all", X ? "hover:text-foreground hover:bg-secondary active:scale-95" : "opacity-30 cursor-not-allowed",
|
|
114
|
-
children: /* @__PURE__ */
|
|
113
|
+
className: e("p-1.5 text-foreground/70 transition-all", X ? "hover:text-foreground hover:bg-secondary active:scale-95" : "opacity-30 cursor-not-allowed", y),
|
|
114
|
+
children: /* @__PURE__ */ p(t, {})
|
|
115
115
|
})
|
|
116
116
|
]
|
|
117
|
-
}), /* @__PURE__ */
|
|
117
|
+
}), /* @__PURE__ */ m("table", {
|
|
118
118
|
role: "grid",
|
|
119
|
-
"aria-label": `${
|
|
119
|
+
"aria-label": `${r[E]} ${w}`,
|
|
120
120
|
tabIndex: -1,
|
|
121
|
-
onKeyDown:
|
|
121
|
+
onKeyDown: z,
|
|
122
122
|
className: "w-full table-fixed border-separate border-spacing-1 text-center",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ p("thead", { children: /* @__PURE__ */ p("tr", { children: n.map((e) => /* @__PURE__ */ p("th", {
|
|
124
124
|
scope: "col",
|
|
125
125
|
className: "text-[11px] font-bold tracking-wider text-foreground/50 uppercase py-1 mb-1",
|
|
126
126
|
children: e
|
|
127
|
-
}, e)) }) }), /* @__PURE__ */
|
|
127
|
+
}, e)) }) }), /* @__PURE__ */ p("tbody", { children: se.map((t, n) => /* @__PURE__ */ p("tr", { children: t.map(({ key: t, day: n }) => n === null ? /* @__PURE__ */ p("td", {}, t) : /* @__PURE__ */ p("td", {
|
|
128
128
|
role: "gridcell",
|
|
129
129
|
tabIndex: -1,
|
|
130
130
|
"aria-selected": q(n),
|
|
131
131
|
"aria-current": J(n) ? "date" : void 0,
|
|
132
|
-
children: /* @__PURE__ */
|
|
132
|
+
children: /* @__PURE__ */ p("button", {
|
|
133
133
|
ref: (e) => {
|
|
134
|
-
|
|
134
|
+
F.current[L(new Date(w, E, n))] = e;
|
|
135
135
|
},
|
|
136
136
|
type: "button",
|
|
137
|
-
tabIndex:
|
|
138
|
-
"aria-label": `${n} ${
|
|
139
|
-
onClick: () =>
|
|
137
|
+
tabIndex: N.getFullYear() === w && N.getMonth() === E && N.getDate() === n ? 0 : -1,
|
|
138
|
+
"aria-label": `${n} ${r[E]} ${w}`,
|
|
139
|
+
onClick: () => G(n),
|
|
140
140
|
disabled: Y(n),
|
|
141
|
-
className: e("w-full flex items-center justify-center font-medium transition-all duration-200",
|
|
141
|
+
className: e("w-full flex items-center justify-center font-medium transition-all duration-200", o[_], y, Y(n) ? "opacity-30 cursor-not-allowed text-foreground/50" : "active:scale-90", !Y(n) && !q(n) && !J(n) && B.hover, q(n) && e(B.bg, "font-semibold shadow-sm"), J(n) && !q(n) && e("border", B.border, B.text), !q(n) && !J(n) && "text-foreground"),
|
|
142
142
|
children: n
|
|
143
143
|
})
|
|
144
144
|
}, t)) }, t[0]?.key ?? `week-${n}`)) })]
|
|
145
145
|
})]
|
|
146
|
-
}), ae && /* @__PURE__ */
|
|
146
|
+
}), ae && /* @__PURE__ */ m("div", {
|
|
147
147
|
className: e("flex items-center justify-center gap-4", Z && "pl-5 ml-4 border-l border-border/60"),
|
|
148
148
|
children: [
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
value:
|
|
149
|
+
/* @__PURE__ */ p(s, {
|
|
150
|
+
value: O,
|
|
151
151
|
max: 23,
|
|
152
152
|
label: "HH",
|
|
153
|
-
onChange:
|
|
154
|
-
resolvedColor:
|
|
155
|
-
radiusClass:
|
|
153
|
+
onChange: H,
|
|
154
|
+
resolvedColor: v,
|
|
155
|
+
radiusClass: y
|
|
156
156
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
value:
|
|
157
|
+
/* @__PURE__ */ p(s, {
|
|
158
|
+
value: k,
|
|
159
159
|
max: 59,
|
|
160
160
|
label: "MM",
|
|
161
|
-
onChange:
|
|
162
|
-
resolvedColor:
|
|
163
|
-
radiusClass:
|
|
161
|
+
onChange: U,
|
|
162
|
+
resolvedColor: v,
|
|
163
|
+
radiusClass: y
|
|
164
164
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
value:
|
|
165
|
+
/* @__PURE__ */ p(s, {
|
|
166
|
+
value: j,
|
|
167
167
|
max: 59,
|
|
168
168
|
label: "SS",
|
|
169
|
-
onChange:
|
|
170
|
-
resolvedColor:
|
|
171
|
-
radiusClass:
|
|
169
|
+
onChange: W,
|
|
170
|
+
resolvedColor: v,
|
|
171
|
+
radiusClass: y
|
|
172
172
|
})
|
|
173
173
|
]
|
|
174
174
|
})]
|
|
175
|
-
}), oe && /* @__PURE__ */
|
|
175
|
+
}), oe && /* @__PURE__ */ m("div", {
|
|
176
176
|
className: "flex items-center justify-between border-t border-border/60 pt-3 mt-3",
|
|
177
|
-
children: [
|
|
177
|
+
children: [g && c ? /* @__PURE__ */ p("button", {
|
|
178
178
|
type: "button",
|
|
179
179
|
onClick: () => {
|
|
180
|
-
|
|
180
|
+
b(null), x();
|
|
181
181
|
},
|
|
182
182
|
className: "text-xs font-medium text-foreground/50 hover:text-danger transition-colors active:scale-95 px-2 py-1",
|
|
183
183
|
children: "Clear"
|
|
184
|
-
}) : /* @__PURE__ */
|
|
184
|
+
}) : /* @__PURE__ */ p("div", {}), h !== "date" && /* @__PURE__ */ p("button", {
|
|
185
185
|
type: "button",
|
|
186
|
-
onClick:
|
|
187
|
-
className: e("ml-auto text-xs font-semibold px-4 py-2 transition-all hover:opacity-90 active:scale-95 shadow-sm",
|
|
186
|
+
onClick: x,
|
|
187
|
+
className: e("ml-auto text-xs font-semibold px-4 py-2 transition-all hover:opacity-90 active:scale-95 shadow-sm", y, B.bg),
|
|
188
188
|
children: "Done"
|
|
189
189
|
})]
|
|
190
190
|
})]
|
|
191
191
|
});
|
|
192
192
|
});
|
|
193
193
|
//#endregion
|
|
194
|
-
export {
|
|
194
|
+
export { h as DateGrid };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* What a clipboard consumer renders with.
|
|
4
|
+
*/
|
|
5
|
+
export interface ClipboardState {
|
|
6
|
+
/**
|
|
7
|
+
* Whether the text is on the clipboard.
|
|
8
|
+
* It returns to false after the configured timeout.
|
|
9
|
+
*/
|
|
10
|
+
copied: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the last attempt failed.
|
|
13
|
+
* A browser refuses clipboard access outside a user gesture or without
|
|
14
|
+
* permission, which is a state a consumer usually wants to surface.
|
|
15
|
+
*/
|
|
16
|
+
error: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Copy the component's value, or the given text.
|
|
19
|
+
*
|
|
20
|
+
* @param text - Text to copy instead of the component's value.
|
|
21
|
+
* @returns Whether the copy succeeded.
|
|
22
|
+
*/
|
|
23
|
+
copy: (text?: string) => Promise<boolean>;
|
|
24
|
+
/** Clear the copied and error states without copying. */
|
|
25
|
+
reset: () => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Props for the Clipboard component.
|
|
29
|
+
*/
|
|
30
|
+
export interface ClipboardProps {
|
|
31
|
+
/** Text copied when `copy` is called without an argument. */
|
|
32
|
+
value?: string;
|
|
33
|
+
/**
|
|
34
|
+
* How long the copied state lasts, in milliseconds.
|
|
35
|
+
* Defaults to `components.clipboard.timeout`, then to the framework fallback.
|
|
36
|
+
*/
|
|
37
|
+
timeout?: number;
|
|
38
|
+
/** Called after a successful copy. */
|
|
39
|
+
onCopy?: (text: string) => void;
|
|
40
|
+
/** Called after a failed copy. */
|
|
41
|
+
onError?: (error: unknown) => void;
|
|
42
|
+
/** Renders the control, using the clipboard state. */
|
|
43
|
+
children: (state: ClipboardState) => ReactNode;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Copies text and reports the result through a render function.
|
|
47
|
+
*
|
|
48
|
+
* The copied state is a timer, not a change of value, so this component keeps
|
|
49
|
+
* one and clears it on unmount. Copying is a user-triggered side effect, so the
|
|
50
|
+
* component performs no clipboard work during render and renders identically on
|
|
51
|
+
* the server and the client.
|
|
52
|
+
*
|
|
53
|
+
* @param props - The value, the timing and the render function.
|
|
54
|
+
* @param props.value - Text copied by a bare `copy()` call.
|
|
55
|
+
* @param props.timeout - How long the copied state lasts.
|
|
56
|
+
* @param props.onCopy - Called after a successful copy.
|
|
57
|
+
* @param props.onError - Called after a failed copy.
|
|
58
|
+
* @param props.children - Renders the control.
|
|
59
|
+
* @returns The rendered control.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* <Clipboard value={invoice.id}>
|
|
64
|
+
* {({ copied, copy }) => (
|
|
65
|
+
* <button type="button" onClick={() => copy()}>
|
|
66
|
+
* {copied ? "Copied" : "Copy invoice number"}
|
|
67
|
+
* </button>
|
|
68
|
+
* )}
|
|
69
|
+
* </Clipboard>
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @see CopyButton - The framework's own copy control.
|
|
73
|
+
*/
|
|
74
|
+
export declare function Clipboard({ value, timeout, onCopy, onError, children, }: ClipboardProps): import("react").JSX.Element;
|
|
75
|
+
//# sourceMappingURL=Clipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Clipboard.d.ts","sourceRoot":"","sources":["../../../src/components/clipboard/Clipboard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EACL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAKf;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf;;;;;OAKG;IACH,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1C,yDAAyD;IACzD,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sCAAsC;IACtC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEhC,kCAAkC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAEnC,sDAAsD;IACtD,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,SAAS,CAAC;CAChD;AA0CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,OAAO,EACP,MAAM,EACN,OAAO,EACP,QAAQ,GACT,EAAE,cAAc,+BAiEhB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { useAsheeConfig as e } from "../../libs/context.js";
|
|
4
|
+
import { resolveAnimate as t } from "../../utils/resolve-token.js";
|
|
5
|
+
import { FALLBACK_CLIPBOARD_CONFIG as n } from "./clipboard-config.js";
|
|
6
|
+
import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
7
|
+
import { Fragment as s, jsx as c } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/clipboard/Clipboard.tsx
|
|
9
|
+
async function l(e) {
|
|
10
|
+
if (typeof navigator < "u" && navigator.clipboard?.writeText) return await navigator.clipboard.writeText(e), !0;
|
|
11
|
+
if (typeof document > "u") return !1;
|
|
12
|
+
let t = document.createElement("textarea");
|
|
13
|
+
t.value = e, t.setAttribute("readonly", ""), t.style.position = "fixed", t.style.opacity = "0";
|
|
14
|
+
let n = document.activeElement;
|
|
15
|
+
document.body.appendChild(t), t.select();
|
|
16
|
+
try {
|
|
17
|
+
return document.execCommand("copy");
|
|
18
|
+
} finally {
|
|
19
|
+
t.remove(), n instanceof HTMLElement && n.focus();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function u({ value: u, timeout: d, onCopy: f, onError: p, children: m }) {
|
|
23
|
+
let h = e(), g = t(d, h.components?.clipboard?.timeout, n.timeout), [_, v] = o(!1), [y, b] = o(!1), x = a(null), S = r(() => {
|
|
24
|
+
x.current !== null && (clearTimeout(x.current), x.current = null);
|
|
25
|
+
}, []);
|
|
26
|
+
i(() => S, [S]);
|
|
27
|
+
let C = r(() => {
|
|
28
|
+
S(), v(!1), b(!1);
|
|
29
|
+
}, [S]), w = r(async (e) => {
|
|
30
|
+
let t = e ?? u ?? "";
|
|
31
|
+
try {
|
|
32
|
+
return await l(t) ? (S(), b(!1), v(!0), f?.(t), x.current = setTimeout(() => {
|
|
33
|
+
v(!1), x.current = null;
|
|
34
|
+
}, g), !0) : (S(), b(!0), v(!1), p?.(/* @__PURE__ */ Error("Clipboard access was refused")), !1);
|
|
35
|
+
} catch (e) {
|
|
36
|
+
return S(), b(!0), v(!1), p?.(e), !1;
|
|
37
|
+
}
|
|
38
|
+
}, [
|
|
39
|
+
S,
|
|
40
|
+
f,
|
|
41
|
+
p,
|
|
42
|
+
g,
|
|
43
|
+
u
|
|
44
|
+
]);
|
|
45
|
+
return /* @__PURE__ */ c(s, { children: m({
|
|
46
|
+
copied: _,
|
|
47
|
+
error: y,
|
|
48
|
+
copy: w,
|
|
49
|
+
reset: C
|
|
50
|
+
}) });
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { u as Clipboard };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from '../button/Button';
|
|
3
|
+
type BaseCopyButtonProps = Omit<ButtonProps, "children" | "startContent" | "endContent" | "onClick" | "onCopy" | "isLoading">;
|
|
4
|
+
/**
|
|
5
|
+
* Props for the CopyButton component.
|
|
6
|
+
*/
|
|
7
|
+
export interface CopyButtonProps extends BaseCopyButtonProps {
|
|
8
|
+
/** Text written to the clipboard. */
|
|
9
|
+
value: string;
|
|
10
|
+
/** Name of the control. Defaults to `components.clipboard.label`. */
|
|
11
|
+
label?: ReactNode;
|
|
12
|
+
/** Name of the control once the text is copied. Defaults to
|
|
13
|
+
* `components.clipboard.copiedLabel`. */
|
|
14
|
+
copiedLabel?: ReactNode;
|
|
15
|
+
/** Announcement made through the status region once the text is copied. */
|
|
16
|
+
copiedAnnouncement?: string;
|
|
17
|
+
/**
|
|
18
|
+
* How long the copied state lasts, in milliseconds.
|
|
19
|
+
* Defaults to `components.clipboard.timeout`.
|
|
20
|
+
*/
|
|
21
|
+
timeout?: number;
|
|
22
|
+
/** Called after a successful copy. */
|
|
23
|
+
onCopy?: (text: string) => void;
|
|
24
|
+
/** Called after a failed copy. */
|
|
25
|
+
onError?: (error: unknown) => void;
|
|
26
|
+
/** Icon shown before the copy. @default CopyIcon */
|
|
27
|
+
copyIcon?: ReactNode;
|
|
28
|
+
/** Icon shown after a successful copy. @default CheckIcon */
|
|
29
|
+
copiedIcon?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A button that copies a value to the clipboard.
|
|
33
|
+
*
|
|
34
|
+
* The control reports its result twice: the label changes to the copied wording
|
|
35
|
+
* and a status region announces the same thing, because a label change alone is
|
|
36
|
+
* not announced by a screen reader. Focus stays on the button, so a reader can
|
|
37
|
+
* copy again immediately.
|
|
38
|
+
*
|
|
39
|
+
* @param props - CopyButton configuration options and button props.
|
|
40
|
+
* @param props.value - Text written to the clipboard.
|
|
41
|
+
* @param props.label - Name of the control before a copy.
|
|
42
|
+
* @param props.copiedLabel - Name of the control after a copy.
|
|
43
|
+
* @param props.copiedAnnouncement - Announcement made after a copy.
|
|
44
|
+
* @param props.timeout - How long the copied state lasts.
|
|
45
|
+
* @param props.onCopy - Called after a successful copy.
|
|
46
|
+
* @param props.onError - Called after a failed copy.
|
|
47
|
+
* @param props.copyIcon - Icon shown before the copy.
|
|
48
|
+
* @param props.copiedIcon - Icon shown after a copy.
|
|
49
|
+
* @returns The rendered control and its status region.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <CopyButton
|
|
54
|
+
* value="INV-1042"
|
|
55
|
+
* label="Copy invoice number"
|
|
56
|
+
* copiedAnnouncement="Invoice number copied"
|
|
57
|
+
* />
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @see Clipboard - The headless primitive, for a consumer's own control.
|
|
61
|
+
*/
|
|
62
|
+
export declare const CopyButton: import('react').ForwardRefExoticComponent<CopyButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=CopyButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyButton.d.ts","sourceRoot":"","sources":["../../../src/components/clipboard/CopyButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKnD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAK5D,KAAK,mBAAmB,GAAG,IAAI,CAC7B,WAAW,EACT,UAAU,GACV,cAAc,GACd,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,WAAW,CACd,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IAEd,qEAAqE;IACrE,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;6CACyC;IACzC,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB,2EAA2E;IAC3E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sCAAsC;IACtC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEhC,kCAAkC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAEnC,oDAAoD;IACpD,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,UAAU,+GAyEtB,CAAC"}
|