@tryghost/shade 0.1.0-alpha.6 → 0.1.0-alpha.61
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 +16 -11
- package/es/app.js +2 -1
- package/es/assets/images/index.js +2 -2
- package/es/components/page-templates/list-page.js +1 -1
- package/es/components/page-templates/list-page.js.map +1 -1
- package/es/components/patterns/color-picker.js +79 -56
- package/es/components/patterns/color-picker.js.map +1 -1
- package/es/components/patterns/filter-bar.js +4 -6
- package/es/components/patterns/filter-bar.js.map +1 -1
- package/es/components/patterns/filters-sheet.js +180 -0
- package/es/components/patterns/filters-sheet.js.map +1 -0
- package/es/components/patterns/filters.js +200 -84
- package/es/components/patterns/filters.js.map +1 -1
- package/es/components/patterns/gh-chart.js +4 -3
- package/es/components/patterns/gh-chart.js.map +1 -1
- package/es/components/patterns/image-upload.js +21 -16
- package/es/components/patterns/image-upload.js.map +1 -1
- package/es/components/patterns/kpi-tabs.js +4 -1
- package/es/components/patterns/kpi-tabs.js.map +1 -1
- package/es/components/patterns/page-header.js +62 -60
- package/es/components/patterns/page-header.js.map +1 -1
- package/es/components/patterns/setting-group-variants.js +1 -1
- package/es/components/patterns/setting-group-variants.js.map +1 -1
- package/es/components/patterns/setting-group.js +5 -5
- package/es/components/patterns/setting-group.js.map +1 -1
- package/es/components/patterns/settings-modal-variants.js +3 -0
- package/es/components/patterns/settings-modal-variants.js.map +1 -1
- package/es/components/patterns/settings-modal.js +12 -5
- package/es/components/patterns/settings-modal.js.map +1 -1
- package/es/components/patterns/share-modal.js +5 -17
- package/es/components/patterns/share-modal.js.map +1 -1
- package/es/components/patterns/use-mobile-filters.js +20 -0
- package/es/components/patterns/use-mobile-filters.js.map +1 -0
- package/es/components/ui/alert-dialog.js +25 -15
- package/es/components/ui/alert-dialog.js.map +1 -1
- package/es/components/ui/avatar.js +3 -4
- package/es/components/ui/avatar.js.map +1 -1
- package/es/components/ui/badge-variants.js +2 -1
- package/es/components/ui/badge-variants.js.map +1 -1
- package/es/components/ui/banner-variants.js +13 -5
- package/es/components/ui/banner-variants.js.map +1 -1
- package/es/components/ui/banner.js +9 -3
- package/es/components/ui/banner.js.map +1 -1
- package/es/components/ui/breadcrumb.js +2 -0
- package/es/components/ui/breadcrumb.js.map +1 -1
- package/es/components/ui/button-variants.js +2 -33
- package/es/components/ui/button-variants.js.map +1 -1
- package/es/components/ui/button.js +18 -5
- package/es/components/ui/button.js.map +1 -1
- package/es/components/ui/calendar.js +5 -6
- package/es/components/ui/calendar.js.map +1 -1
- package/es/components/ui/card-variants.js +3 -2
- package/es/components/ui/card-variants.js.map +1 -1
- package/es/components/ui/card.js +7 -4
- package/es/components/ui/card.js.map +1 -1
- package/es/components/ui/chart.js +2 -29
- package/es/components/ui/chart.js.map +1 -1
- package/es/components/ui/checkbox.js +1 -1
- package/es/components/ui/checkbox.js.map +1 -1
- package/es/components/ui/code-editor-view.js +1 -1
- package/es/components/ui/code-editor-view.js.map +1 -1
- package/es/components/ui/combobox.js +1 -1
- package/es/components/ui/combobox.js.map +1 -1
- package/es/components/ui/command.js +1 -14
- package/es/components/ui/command.js.map +1 -1
- package/es/components/ui/context-menu.js +18 -8
- package/es/components/ui/context-menu.js.map +1 -1
- package/es/components/ui/copy-field.js +2 -4
- package/es/components/ui/copy-field.js.map +1 -1
- package/es/components/ui/data-list.js +2 -4
- package/es/components/ui/data-list.js.map +1 -1
- package/es/components/ui/dialog.js +53 -11
- package/es/components/ui/dialog.js.map +1 -1
- package/es/components/ui/dropdown-menu.js +20 -10
- package/es/components/ui/dropdown-menu.js.map +1 -1
- package/es/components/ui/dropzone-variants.js +26 -10
- package/es/components/ui/dropzone-variants.js.map +1 -1
- package/es/components/ui/dropzone.js +2 -2
- package/es/components/ui/dropzone.js.map +1 -1
- package/es/components/ui/field.js +4 -4
- package/es/components/ui/field.js.map +1 -1
- package/es/components/ui/flag.js.map +1 -1
- package/es/components/ui/floating-sidebar.js +83 -21
- package/es/components/ui/floating-sidebar.js.map +1 -1
- package/es/components/ui/hover-card.js +13 -7
- package/es/components/ui/hover-card.js.map +1 -1
- package/es/components/ui/icon.js +1 -1
- package/es/components/ui/image-overlay-button.js +2 -2
- package/es/components/ui/image-overlay-button.js.map +1 -1
- package/es/components/ui/indicator-variants.js +2 -2
- package/es/components/ui/indicator-variants.js.map +1 -1
- package/es/components/ui/input-group-variants.js +5 -5
- package/es/components/ui/input-group-variants.js.map +1 -1
- package/es/components/ui/input-group.js +4 -7
- package/es/components/ui/input-group.js.map +1 -1
- package/es/components/ui/input-surface.js +5 -4
- package/es/components/ui/input-surface.js.map +1 -1
- package/es/components/ui/input.js +1 -1
- package/es/components/ui/input.js.map +1 -1
- package/es/components/ui/list.js +94 -0
- package/es/components/ui/list.js.map +1 -0
- package/es/components/ui/navbar.js +1 -3
- package/es/components/ui/navbar.js.map +1 -1
- package/es/components/ui/pagemenu.js +51 -15
- package/es/components/ui/pagemenu.js.map +1 -1
- package/es/components/ui/popover.js +14 -8
- package/es/components/ui/popover.js.map +1 -1
- package/es/components/ui/radio-group-variants.js +1 -1
- package/es/components/ui/radio-group-variants.js.map +1 -1
- package/es/components/ui/row-primary-action.js +48 -0
- package/es/components/ui/row-primary-action.js.map +1 -0
- package/es/components/ui/row-surface.js +18 -0
- package/es/components/ui/row-surface.js.map +1 -0
- package/es/components/ui/select-variants.js +6 -14
- package/es/components/ui/select-variants.js.map +1 -1
- package/es/components/ui/select.js +26 -19
- package/es/components/ui/select.js.map +1 -1
- package/es/components/ui/sheet.js +32 -19
- package/es/components/ui/sheet.js.map +1 -1
- package/es/components/ui/sidebar.js +2 -2
- package/es/components/ui/simple-pagination.js +4 -7
- package/es/components/ui/simple-pagination.js.map +1 -1
- package/es/components/ui/sortable-list.js +110 -11
- package/es/components/ui/sortable-list.js.map +1 -1
- package/es/components/ui/sticky-footer.js +62 -22
- package/es/components/ui/sticky-footer.js.map +1 -1
- package/es/components/ui/table.js +20 -9
- package/es/components/ui/table.js.map +1 -1
- package/es/components/ui/tabs-variants.js +23 -1
- package/es/components/ui/tabs-variants.js.map +1 -1
- package/es/components/ui/tabs.js +145 -27
- package/es/components/ui/tabs.js.map +1 -1
- package/es/components/ui/textarea.js +1 -1
- package/es/components/ui/textarea.js.map +1 -1
- package/es/components/ui/toast.js +2 -0
- package/es/components/ui/toggle-group.js +1 -3
- package/es/components/ui/toggle-group.js.map +1 -1
- package/es/components/ui/toggle-variants.js +1 -7
- package/es/components/ui/toggle-variants.js.map +1 -1
- package/es/components/ui/toggle.js +1 -2
- package/es/components/ui/toggle.js.map +1 -1
- package/es/components/ui/token-field.js +3 -3
- package/es/components/ui/token-field.js.map +1 -1
- package/es/components/ui/tooltip.js +81 -40
- package/es/components/ui/tooltip.js.map +1 -1
- package/es/components/ui/trend-badge.js +46 -12
- package/es/components/ui/trend-badge.js.map +1 -1
- package/es/components.js +24 -21
- package/es/hooks/use-row-behavior.js +94 -0
- package/es/hooks/use-row-behavior.js.map +1 -0
- package/es/hooks/use-row-press.js +63 -0
- package/es/hooks/use-row-press.js.map +1 -0
- package/es/{icon-BJcGsQ4b.js → icon--CakqPdG.js} +15 -19
- package/es/icon--CakqPdG.js.map +1 -0
- package/es/{images-CUcakpOD.js → images-F6slcZrB.js} +16 -42
- package/es/images-F6slcZrB.js.map +1 -0
- package/es/index.js +43 -39
- package/es/lib/app-overlay.js +184 -0
- package/es/lib/app-overlay.js.map +1 -0
- package/es/lib/date-utils.js +151 -0
- package/es/lib/date-utils.js.map +1 -0
- package/es/lib/ds-utils.js +16 -72
- package/es/lib/ds-utils.js.map +1 -1
- package/es/lib/safe-area.js +168 -0
- package/es/lib/safe-area.js.map +1 -0
- package/es/lib/svg-graphic.js +32 -0
- package/es/lib/svg-graphic.js.map +1 -0
- package/es/lib/toast-press.js +11 -0
- package/es/lib/toast-press.js.map +1 -0
- package/es/lib/utils.js +3 -2
- package/es/patterns.js +2 -1
- package/es/providers/header-tooltip-provider.js +1 -4
- package/es/providers/header-tooltip-provider.js.map +1 -1
- package/es/providers/shade-context.js +2 -1
- package/es/providers/shade-context.js.map +1 -1
- package/es/providers/shade-provider.js +28 -13
- package/es/providers/shade-provider.js.map +1 -1
- package/es/shade-app.js +22 -6
- package/es/shade-app.js.map +1 -1
- package/es/shade-scope.js +3 -2
- package/es/shade-scope.js.map +1 -1
- package/es/tokens.js +66 -8
- package/es/tokens.js.map +1 -1
- package/es/utils.js +3 -2
- package/package.json +7 -7
- package/preflight.css +0 -10
- package/styles.css +485 -12
- package/tailwind.theme.css +241 -187
- package/theme-variables.css +215 -69
- package/types/app.d.ts +7 -5
- package/types/app.d.ts.map +1 -1
- package/types/assets/images/index.d.ts +3 -3
- package/types/assets/images/index.d.ts.map +1 -1
- package/types/components/page-templates/modal-page.d.ts +1 -1
- package/types/components/patterns/color-picker.d.ts +7 -2
- package/types/components/patterns/color-picker.d.ts.map +1 -1
- package/types/components/patterns/filter-bar.d.ts +2 -2
- package/types/components/patterns/filter-bar.d.ts.map +1 -1
- package/types/components/patterns/filters-helpers.d.ts +1 -1
- package/types/components/patterns/filters-sheet.d.ts +21 -0
- package/types/components/patterns/filters-sheet.d.ts.map +1 -0
- package/types/components/patterns/filters.d.ts +21 -7
- package/types/components/patterns/filters.d.ts.map +1 -1
- package/types/components/patterns/gh-chart.d.ts.map +1 -1
- package/types/components/patterns/image-upload.d.ts +3 -3
- package/types/components/patterns/image-upload.d.ts.map +1 -1
- package/types/components/patterns/kpi-tabs.d.ts +5 -2
- package/types/components/patterns/kpi-tabs.d.ts.map +1 -1
- package/types/components/patterns/page-header.d.ts +26 -17
- package/types/components/patterns/page-header.d.ts.map +1 -1
- package/types/components/patterns/setting-group.d.ts +8 -8
- package/types/components/patterns/setting-group.d.ts.map +1 -1
- package/types/components/patterns/settings-modal-variants.d.ts +3 -0
- package/types/components/patterns/settings-modal-variants.d.ts.map +1 -1
- package/types/components/patterns/settings-modal.d.ts +12 -3
- package/types/components/patterns/settings-modal.d.ts.map +1 -1
- package/types/components/patterns/share-modal.d.ts +3 -3
- package/types/components/patterns/share-modal.d.ts.map +1 -1
- package/types/components/patterns/use-dirty-confirmation.d.ts +1 -1
- package/types/components/patterns/use-mobile-filters.d.ts +2 -0
- package/types/components/patterns/use-mobile-filters.d.ts.map +1 -0
- package/types/components/ui/alert-dialog.d.ts +2 -2
- package/types/components/ui/alert-dialog.d.ts.map +1 -1
- package/types/components/ui/badge-variants.d.ts +1 -1
- package/types/components/ui/badge-variants.d.ts.map +1 -1
- package/types/components/ui/badge.d.ts +1 -1
- package/types/components/ui/banner-variants.d.ts +1 -1
- package/types/components/ui/banner-variants.d.ts.map +1 -1
- package/types/components/ui/banner.d.ts +3 -1
- package/types/components/ui/banner.d.ts.map +1 -1
- package/types/components/ui/breadcrumb.d.ts.map +1 -1
- package/types/components/ui/button-variants.d.ts +0 -1
- package/types/components/ui/button-variants.d.ts.map +1 -1
- package/types/components/ui/button.d.ts +7 -2
- package/types/components/ui/button.d.ts.map +1 -1
- package/types/components/ui/calendar.d.ts +1 -1
- package/types/components/ui/calendar.d.ts.map +1 -1
- package/types/components/ui/card-variants.d.ts +1 -1
- package/types/components/ui/card-variants.d.ts.map +1 -1
- package/types/components/ui/card.d.ts +1 -1
- package/types/components/ui/card.d.ts.map +1 -1
- package/types/components/ui/chart.d.ts +1 -17
- package/types/components/ui/chart.d.ts.map +1 -1
- package/types/components/ui/code-editor.d.ts +1 -1
- package/types/components/ui/command.d.ts +1 -6
- package/types/components/ui/command.d.ts.map +1 -1
- package/types/components/ui/context-menu.d.ts +1 -1
- package/types/components/ui/context-menu.d.ts.map +1 -1
- package/types/components/ui/copy-field.d.ts +1 -1
- package/types/components/ui/copy-field.d.ts.map +1 -1
- package/types/components/ui/data-list.d.ts.map +1 -1
- package/types/components/ui/dialog.d.ts +11 -2
- package/types/components/ui/dialog.d.ts.map +1 -1
- package/types/components/ui/dropdown-menu.d.ts +1 -1
- package/types/components/ui/dropdown-menu.d.ts.map +1 -1
- package/types/components/ui/dropzone-variants.d.ts +3 -2
- package/types/components/ui/dropzone-variants.d.ts.map +1 -1
- package/types/components/ui/dropzone.d.ts +1 -1
- package/types/components/ui/field.d.ts +1 -1
- package/types/components/ui/field.d.ts.map +1 -1
- package/types/components/ui/floating-sidebar.d.ts +12 -3
- package/types/components/ui/floating-sidebar.d.ts.map +1 -1
- package/types/components/ui/hover-card.d.ts.map +1 -1
- package/types/components/ui/icon.d.ts +2 -1
- package/types/components/ui/icon.d.ts.map +1 -1
- package/types/components/ui/image-overlay-button.d.ts +1 -1
- package/types/components/ui/image-overlay-button.d.ts.map +1 -1
- package/types/components/ui/indicator.d.ts +1 -1
- package/types/components/ui/input-group-variants.d.ts.map +1 -1
- package/types/components/ui/input-group.d.ts +2 -2
- package/types/components/ui/input-group.d.ts.map +1 -1
- package/types/components/ui/input-surface.d.ts +4 -3
- package/types/components/ui/input-surface.d.ts.map +1 -1
- package/types/components/ui/list.d.ts +28 -0
- package/types/components/ui/list.d.ts.map +1 -0
- package/types/components/ui/multi-select-combobox.d.ts +1 -1
- package/types/components/ui/navbar.d.ts.map +1 -1
- package/types/components/ui/pagemenu.d.ts +3 -0
- package/types/components/ui/pagemenu.d.ts.map +1 -1
- package/types/components/ui/popover.d.ts.map +1 -1
- package/types/components/ui/preview-chrome.d.ts +1 -1
- package/types/components/ui/row-primary-action.d.ts +8 -0
- package/types/components/ui/row-primary-action.d.ts.map +1 -0
- package/types/components/ui/row-surface.d.ts +11 -0
- package/types/components/ui/row-surface.d.ts.map +1 -0
- package/types/components/ui/select-variants.d.ts +0 -1
- package/types/components/ui/select-variants.d.ts.map +1 -1
- package/types/components/ui/select.d.ts +2 -2
- package/types/components/ui/select.d.ts.map +1 -1
- package/types/components/ui/sheet.d.ts +1 -1
- package/types/components/ui/sheet.d.ts.map +1 -1
- package/types/components/ui/sidebar.d.ts +2 -2
- package/types/components/ui/simple-pagination.d.ts.map +1 -1
- package/types/components/ui/sortable-list.d.ts +4 -1
- package/types/components/ui/sortable-list.d.ts.map +1 -1
- package/types/components/ui/sticky-footer.d.ts +9 -2
- package/types/components/ui/sticky-footer.d.ts.map +1 -1
- package/types/components/ui/table.d.ts +4 -1
- package/types/components/ui/table.d.ts.map +1 -1
- package/types/components/ui/tabs-variants.d.ts +5 -1
- package/types/components/ui/tabs-variants.d.ts.map +1 -1
- package/types/components/ui/tabs.d.ts.map +1 -1
- package/types/components/ui/toast.d.ts +2 -0
- package/types/components/ui/toast.d.ts.map +1 -0
- package/types/components/ui/toggle-group.d.ts +4 -6
- package/types/components/ui/toggle-group.d.ts.map +1 -1
- package/types/components/ui/toggle-variants.d.ts +0 -1
- package/types/components/ui/toggle-variants.d.ts.map +1 -1
- package/types/components/ui/toggle.d.ts +2 -3
- package/types/components/ui/toggle.d.ts.map +1 -1
- package/types/components/ui/token-field.d.ts +2 -2
- package/types/components/ui/token-field.d.ts.map +1 -1
- package/types/components/ui/tooltip.d.ts.map +1 -1
- package/types/components/ui/trend-badge.d.ts +1 -0
- package/types/components/ui/trend-badge.d.ts.map +1 -1
- package/types/components.d.ts +5 -2
- package/types/components.d.ts.map +1 -1
- package/types/hooks/use-row-behavior.d.ts +24 -0
- package/types/hooks/use-row-behavior.d.ts.map +1 -0
- package/types/hooks/use-row-press.d.ts +11 -0
- package/types/hooks/use-row-press.d.ts.map +1 -0
- package/types/lib/app-overlay.d.ts +63 -0
- package/types/lib/app-overlay.d.ts.map +1 -0
- package/types/lib/date-utils.d.ts +17 -0
- package/types/lib/date-utils.d.ts.map +1 -0
- package/types/lib/ds-utils.d.ts +2 -16
- package/types/lib/ds-utils.d.ts.map +1 -1
- package/types/lib/safe-area.d.ts +27 -0
- package/types/lib/safe-area.d.ts.map +1 -0
- package/types/lib/svg-graphic.d.ts +22 -0
- package/types/lib/svg-graphic.d.ts.map +1 -0
- package/types/lib/toast-press.d.ts +4 -0
- package/types/lib/toast-press.d.ts.map +1 -0
- package/types/lib/utils.d.ts +1 -0
- package/types/lib/utils.d.ts.map +1 -1
- package/types/patterns.d.ts +1 -0
- package/types/patterns.d.ts.map +1 -1
- package/types/providers/header-tooltip-provider.d.ts.map +1 -1
- package/types/providers/shade-context.d.ts +4 -1
- package/types/providers/shade-context.d.ts.map +1 -1
- package/types/providers/shade-provider.d.ts +5 -2
- package/types/providers/shade-provider.d.ts.map +1 -1
- package/types/shade-app.d.ts +11 -3
- package/types/shade-app.d.ts.map +1 -1
- package/types/shade-scope.d.ts.map +1 -1
- package/types/tokens.d.ts +1 -1
- package/types/tokens.d.ts.map +1 -1
- package/types/utils.d.ts +2 -1
- package/types/utils.d.ts.map +1 -1
- package/es/components/ui/action-list.js +0 -56
- package/es/components/ui/action-list.js.map +0 -1
- package/es/icon-BJcGsQ4b.js.map +0 -1
- package/es/images-CUcakpOD.js.map +0 -1
- package/types/components/ui/action-list.d.ts +0 -21
- package/types/components/ui/action-list.d.ts.map +0 -1
package/es/components/ui/tabs.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { cn } from "../../lib/ds-utils.js";
|
|
2
2
|
import { useShade } from "../../providers/shade-context.js";
|
|
3
|
+
import { Box } from "../primitives/box.js";
|
|
3
4
|
import { DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
5
|
+
import { tabSurfaceVariants } from "./tabs-variants.js";
|
|
4
6
|
import * as React$1 from "react";
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
8
|
import { cva } from "class-variance-authority";
|
|
7
9
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
8
10
|
//#region src/components/ui/tabs.tsx
|
|
@@ -10,11 +12,12 @@ var TabsContext = React$1.createContext({
|
|
|
10
12
|
variant: "segmented",
|
|
11
13
|
controlShape: "rounded"
|
|
12
14
|
});
|
|
13
|
-
var Tabs = React$1.forwardRef(({ variant
|
|
14
|
-
const { controlShape } = useShade();
|
|
15
|
+
var Tabs = React$1.forwardRef(({ variant, ...props }, ref) => {
|
|
16
|
+
const { controlShape, admin7Design } = useShade();
|
|
17
|
+
const resolvedVariant = variant ?? (admin7Design ? "underline" : "segmented");
|
|
15
18
|
return /* @__PURE__ */ jsx(TabsContext.Provider, {
|
|
16
19
|
value: {
|
|
17
|
-
variant,
|
|
20
|
+
variant: resolvedVariant,
|
|
18
21
|
controlShape
|
|
19
22
|
},
|
|
20
23
|
children: /* @__PURE__ */ jsx(TabsPrimitive.Root, {
|
|
@@ -25,28 +28,81 @@ var Tabs = React$1.forwardRef(({ variant = "segmented", ...props }, ref) => {
|
|
|
25
28
|
});
|
|
26
29
|
Tabs.displayName = TabsPrimitive.Root.displayName;
|
|
27
30
|
var tabsListVariants = cva("inline-flex items-center text-muted-foreground", {
|
|
28
|
-
variants: {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
variants: {
|
|
32
|
+
variant: {
|
|
33
|
+
segmented: "h-(--control-height) rounded-lg bg-muted px-[3px]",
|
|
34
|
+
"segmented-sm": "h-8 rounded-lg bg-muted px-[3px]",
|
|
35
|
+
button: "gap-2",
|
|
36
|
+
"button-sm": "gap-1",
|
|
37
|
+
underline: "no-scrollbar w-full max-w-full gap-5 overflow-x-auto border-b border-border-default",
|
|
38
|
+
navbar: "h-[52px] items-end gap-6",
|
|
39
|
+
pill: "-ml-0.5 h-[30px] gap-px",
|
|
40
|
+
kpis: "border-b ring-0"
|
|
41
|
+
},
|
|
42
|
+
admin7Design: {
|
|
43
|
+
true: "",
|
|
44
|
+
false: ""
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
compoundVariants: [{
|
|
48
|
+
variant: "underline",
|
|
49
|
+
admin7Design: true,
|
|
50
|
+
className: "overflow-y-hidden border-b-0 inset-shadow-[0_-1px_0] inset-shadow-border-default"
|
|
51
|
+
}, {
|
|
52
|
+
variant: ["button", "button-sm"],
|
|
53
|
+
admin7Design: true,
|
|
54
|
+
className: "no-scrollbar max-w-full overflow-x-auto"
|
|
55
|
+
}],
|
|
38
56
|
defaultVariants: { variant: "segmented" }
|
|
39
57
|
});
|
|
40
|
-
var TabsList = React$1.forwardRef(({ className, ...props }, ref) => {
|
|
58
|
+
var TabsList = React$1.forwardRef(({ className, children, style, ...props }, ref) => {
|
|
41
59
|
const { variant } = React$1.useContext(TabsContext);
|
|
42
|
-
|
|
43
|
-
|
|
60
|
+
const { admin7Design, admin7Mobile } = useShade();
|
|
61
|
+
const listRef = React$1.useRef(null);
|
|
62
|
+
const [mask, setMask] = React$1.useState();
|
|
63
|
+
const setRef = React$1.useCallback((element) => {
|
|
64
|
+
listRef.current = element;
|
|
65
|
+
if (typeof ref === "function") ref(element);
|
|
66
|
+
else if (ref) ref.current = element;
|
|
67
|
+
}, [ref]);
|
|
68
|
+
React$1.useEffect(() => {
|
|
69
|
+
const list = listRef.current;
|
|
70
|
+
if (!admin7Mobile || !list) return;
|
|
71
|
+
const update = () => {
|
|
72
|
+
const maxScroll = list.scrollWidth - list.clientWidth;
|
|
73
|
+
const left = getComputedStyle(list).direction === "rtl" ? maxScroll - Math.abs(list.scrollLeft) : list.scrollLeft;
|
|
74
|
+
const fadeLeft = left > 1;
|
|
75
|
+
const fadeRight = maxScroll - left > 1;
|
|
76
|
+
setMask(fadeLeft || fadeRight ? `linear-gradient(to right, ${fadeLeft ? "transparent, black 24px" : "black"}, ${fadeRight ? "black calc(100% - 24px), transparent" : "black"})` : void 0);
|
|
77
|
+
};
|
|
78
|
+
update();
|
|
79
|
+
const observer = new ResizeObserver(update);
|
|
80
|
+
observer.observe(list);
|
|
81
|
+
Array.from(list.children).forEach((child) => observer.observe(child));
|
|
82
|
+
list.addEventListener("scroll", update, { passive: true });
|
|
83
|
+
return () => {
|
|
84
|
+
observer.disconnect();
|
|
85
|
+
list.removeEventListener("scroll", update);
|
|
86
|
+
};
|
|
87
|
+
}, [admin7Mobile, children]);
|
|
88
|
+
const solidDivider = admin7Mobile && variant === "underline";
|
|
89
|
+
const list = /* @__PURE__ */ jsx(TabsPrimitive.List, {
|
|
90
|
+
ref: setRef,
|
|
44
91
|
className: cn(tabsListVariants({
|
|
45
92
|
variant,
|
|
46
|
-
|
|
47
|
-
})),
|
|
48
|
-
|
|
93
|
+
admin7Design
|
|
94
|
+
}), admin7Mobile && mask && "max-lg:[mask-image:var(--tabs-overflow-mask)]", solidDivider && "max-lg:relative max-lg:border-b-transparent max-lg:inset-shadow-none", className),
|
|
95
|
+
style: admin7Mobile && mask ? {
|
|
96
|
+
...style,
|
|
97
|
+
"--tabs-overflow-mask": mask
|
|
98
|
+
} : style,
|
|
99
|
+
...props,
|
|
100
|
+
children
|
|
49
101
|
});
|
|
102
|
+
return solidDivider ? /* @__PURE__ */ jsx(Box, {
|
|
103
|
+
className: "contents max-lg:relative max-lg:block max-lg:before:pointer-events-none max-lg:before:absolute max-lg:before:inset-x-0 max-lg:before:bottom-0 max-lg:before:border-b max-lg:before:border-border-default",
|
|
104
|
+
children: list
|
|
105
|
+
}) : list;
|
|
50
106
|
});
|
|
51
107
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
52
108
|
var tabsTriggerVariants = cva("inline-flex items-center justify-center px-3 py-1 whitespace-nowrap ring-offset-background transition-all focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground [&_svg]:size-4 [&_svg]:shrink-0", {
|
|
@@ -64,9 +120,17 @@ var tabsTriggerVariants = cva("inline-flex items-center justify-center px-3 py-1
|
|
|
64
120
|
controlShape: {
|
|
65
121
|
rounded: "",
|
|
66
122
|
pill: ""
|
|
123
|
+
},
|
|
124
|
+
admin7Design: {
|
|
125
|
+
true: "",
|
|
126
|
+
false: ""
|
|
67
127
|
}
|
|
68
128
|
},
|
|
69
129
|
compoundVariants: [{
|
|
130
|
+
variant: "underline",
|
|
131
|
+
admin7Design: true,
|
|
132
|
+
className: "h-auto py-2.5 text-control-lg font-normal data-[state=active]:font-semibold after:bottom-0 after:h-px"
|
|
133
|
+
}, {
|
|
70
134
|
variant: ["button", "button-sm"],
|
|
71
135
|
controlShape: "pill",
|
|
72
136
|
className: "rounded-full"
|
|
@@ -76,21 +140,71 @@ var tabsTriggerVariants = cva("inline-flex items-center justify-center px-3 py-1
|
|
|
76
140
|
controlShape: "rounded"
|
|
77
141
|
}
|
|
78
142
|
});
|
|
79
|
-
|
|
143
|
+
function renderTabsTriggerLabel(children, asChild = false) {
|
|
144
|
+
if (children === null || children === void 0) return children;
|
|
145
|
+
if (asChild && React$1.isValidElement(children)) return React$1.cloneElement(children, void 0, renderTabsTriggerLabel(children.props.children));
|
|
146
|
+
const sizedChildren = React$1.Children.map(children, (child) => {
|
|
147
|
+
if (typeof child === "string" || typeof child === "number") {
|
|
148
|
+
const label = typeof child === "string" ? child.trim() : child;
|
|
149
|
+
if (label === "") return child;
|
|
150
|
+
const leadingSpace = typeof child === "string" ? child.match(/^\s*/)?.[0] : void 0;
|
|
151
|
+
const trailingSpace = typeof child === "string" ? child.match(/\s*$/)?.[0] : void 0;
|
|
152
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
153
|
+
leadingSpace,
|
|
154
|
+
/* @__PURE__ */ jsxs("span", {
|
|
155
|
+
className: "inline-grid",
|
|
156
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
157
|
+
"aria-hidden": "true",
|
|
158
|
+
className: "pointer-events-none invisible col-start-1 row-start-1 font-semibold select-none",
|
|
159
|
+
children: label
|
|
160
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
161
|
+
className: "col-start-1 row-start-1",
|
|
162
|
+
children: label
|
|
163
|
+
})]
|
|
164
|
+
}),
|
|
165
|
+
trailingSpace
|
|
166
|
+
] });
|
|
167
|
+
}
|
|
168
|
+
if (React$1.isValidElement(child) && (child.type === React$1.Fragment || typeof child.type === "string" && child.type !== "svg")) return React$1.cloneElement(child, void 0, renderTabsTriggerLabel(child.props.children));
|
|
169
|
+
return child;
|
|
170
|
+
});
|
|
171
|
+
const renderedChildren = [];
|
|
172
|
+
let labelChildren = [];
|
|
173
|
+
const flushLabel = () => {
|
|
174
|
+
if (labelChildren.length > 1 && labelChildren.some((child) => typeof child !== "string" || child.trim())) renderedChildren.push(/* @__PURE__ */ jsx("span", { children: labelChildren }, `label-${renderedChildren.length}`));
|
|
175
|
+
else renderedChildren.push(...labelChildren);
|
|
176
|
+
labelChildren = [];
|
|
177
|
+
};
|
|
178
|
+
React$1.Children.toArray(sizedChildren).forEach((child) => {
|
|
179
|
+
if (typeof child === "string" || typeof child === "number" || React$1.isValidElement(child) && (child.type === React$1.Fragment || typeof child.type === "string" && child.type !== "svg")) labelChildren.push(child);
|
|
180
|
+
else {
|
|
181
|
+
flushLabel();
|
|
182
|
+
renderedChildren.push(child);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
flushLabel();
|
|
186
|
+
return renderedChildren;
|
|
187
|
+
}
|
|
188
|
+
var TabsTrigger = React$1.forwardRef(({ children, className, onMouseDownCapture, ...props }, ref) => {
|
|
80
189
|
const { variant, controlShape } = React$1.useContext(TabsContext);
|
|
190
|
+
const { admin7Design } = useShade();
|
|
81
191
|
return /* @__PURE__ */ jsx(TabsPrimitive.Trigger, {
|
|
82
192
|
ref,
|
|
83
193
|
className: cn(tabsTriggerVariants({
|
|
84
194
|
variant,
|
|
85
195
|
controlShape,
|
|
86
|
-
|
|
87
|
-
}))
|
|
196
|
+
admin7Design
|
|
197
|
+
}), (variant === "button" || variant === "button-sm") && tabSurfaceVariants({
|
|
198
|
+
admin7Design,
|
|
199
|
+
size: variant === "button-sm" ? "compact" : "default"
|
|
200
|
+
}), className),
|
|
88
201
|
onMouseDownCapture: (event) => {
|
|
89
202
|
const activeElement = document.activeElement;
|
|
90
203
|
if (activeElement instanceof HTMLElement && activeElement.matches("input, textarea, select, [contenteditable=\"true\"]")) activeElement.blur();
|
|
91
204
|
onMouseDownCapture?.(event);
|
|
92
205
|
},
|
|
93
|
-
...props
|
|
206
|
+
...props,
|
|
207
|
+
children: admin7Design && variant === "underline" ? renderTabsTriggerLabel(children, props.asChild) : children
|
|
94
208
|
});
|
|
95
209
|
});
|
|
96
210
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
@@ -128,6 +242,7 @@ var TabsContent = React$1.forwardRef(({ className, ...props }, ref) => {
|
|
|
128
242
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
129
243
|
var TabsDropdownTrigger = React$1.forwardRef(({ children, className, ...props }, ref) => {
|
|
130
244
|
const { variant, controlShape } = React$1.useContext(TabsContext);
|
|
245
|
+
const { admin7Design } = useShade();
|
|
131
246
|
return /* @__PURE__ */ jsxs("div", {
|
|
132
247
|
className: cn("relative rounded-control hover:bg-tab-hover", (variant === "button" || variant === "button-sm") && controlShape === "pill" && "rounded-full"),
|
|
133
248
|
children: [/* @__PURE__ */ jsx(TabsPrimitive.Trigger, {
|
|
@@ -135,12 +250,15 @@ var TabsDropdownTrigger = React$1.forwardRef(({ children, className, ...props },
|
|
|
135
250
|
className: cn(tabsTriggerVariants({
|
|
136
251
|
variant,
|
|
137
252
|
controlShape,
|
|
138
|
-
|
|
139
|
-
}))
|
|
253
|
+
admin7Design
|
|
254
|
+
}), (variant === "button" || variant === "button-sm") && tabSurfaceVariants({
|
|
255
|
+
admin7Design,
|
|
256
|
+
size: variant === "button-sm" ? "compact" : "default"
|
|
257
|
+
}), className),
|
|
140
258
|
...props,
|
|
141
259
|
children: /* @__PURE__ */ jsx("div", {
|
|
142
260
|
className: "flex items-center gap-2",
|
|
143
|
-
children
|
|
261
|
+
children: admin7Design && variant === "underline" ? renderTabsTriggerLabel(children) : children
|
|
144
262
|
})
|
|
145
263
|
}), /* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
146
264
|
className: "absolute inset-0 size-full cursor-pointer",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","names":[],"sources":["../../../src/components/ui/tabs.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport { DropdownMenuTrigger } from './dropdown-menu';\n\nimport { cn } from '@/lib/utils';\nimport { cva } from 'class-variance-authority';\nimport { type ControlShape, useShade } from '@/providers/shade-context';\n\ntype TabsVariant =\n | 'segmented'\n | 'segmented-sm'\n | 'button'\n | 'button-sm'\n | 'underline'\n | 'navbar'\n | 'pill'\n | 'kpis';\n\ninterface TabsContextValue {\n variant: TabsVariant;\n controlShape: ControlShape;\n}\n\nconst TabsContext = React.createContext<TabsContextValue>({\n variant: 'segmented',\n controlShape: 'rounded',\n});\n\nexport interface TabsProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> {\n variant?: TabsVariant;\n}\n\nconst Tabs = React.forwardRef<React.ElementRef<typeof TabsPrimitive.Root>, TabsProps>(\n ({ variant = 'segmented', ...props }, ref) => {\n const { controlShape } = useShade();\n\n return (\n <TabsContext.Provider value={{ variant, controlShape }}>\n <TabsPrimitive.Root ref={ref} {...props} />\n </TabsContext.Provider>\n );\n },\n);\nTabs.displayName = TabsPrimitive.Root.displayName;\n\nconst tabsListVariants = cva('inline-flex items-center text-muted-foreground', {\n variants: {\n variant: {\n segmented: 'h-(--control-height) rounded-lg bg-muted px-[3px]',\n 'segmented-sm': 'h-8 rounded-lg bg-muted px-[3px]',\n button: 'gap-2',\n 'button-sm': 'gap-1',\n underline:\n 'no-scrollbar w-full max-w-full gap-5 overflow-x-auto border-b border-border-default',\n navbar: 'h-[52px] items-end gap-6',\n pill: '-ml-0.5 h-[30px] gap-px',\n // The `kpis` variant is consumed only by `features/kpi/kpi-tabs.tsx`.\n // Kept here so the cva variant set is in one place; not for direct use by app code.\n kpis: 'border-b ring-0',\n },\n },\n defaultVariants: {\n variant: 'segmented',\n },\n});\n\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const { variant } = React.useContext(TabsContext);\n return (\n <TabsPrimitive.List\n ref={ref}\n className={cn(tabsListVariants({ variant, className }))}\n {...props}\n />\n );\n});\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst tabsTriggerVariants = cva(\n 'inline-flex items-center justify-center px-3 py-1 whitespace-nowrap ring-offset-background transition-all focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground [&_svg]:size-4 [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n segmented:\n 'h-[calc(var(--control-height)-4px)] rounded-control text-control font-medium data-[state=active]:shadow-md',\n 'segmented-sm':\n 'h-[26px] rounded-control text-sm font-medium data-[state=active]:shadow-md',\n button:\n 'h-(--control-height) gap-1.5 rounded-control py-2 text-control font-medium hover:bg-tab-hover data-[state=active]:bg-tab-active data-[state=active]:hover:bg-tab-active',\n 'button-sm':\n 'h-6 gap-1.5 rounded-control p-2 text-sm font-medium text-text-secondary hover:bg-tab-hover data-[state=active]:bg-tab-active data-[state=active]:text-foreground data-[state=active]:hover:bg-tab-active',\n underline:\n 'relative h-9 px-0 text-control font-semibold text-text-secondary after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:bg-foreground after:opacity-0 after:content-[\"\"] hover:after:opacity-10 data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:after:opacity-100!',\n navbar:\n 'relative h-[52px] px-px text-control font-semibold text-muted-foreground after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:bg-foreground after:opacity-0 after:content-[\"\"] hover:text-foreground data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:after:opacity-100!',\n pill: 'relative h-[30px] rounded-md px-3 text-control font-medium text-text-secondary hover:bg-tab-hover hover:text-foreground data-[state=active]:bg-tab-active data-[state=active]:text-foreground data-[state=active]:hover:bg-tab-active',\n kpis: 'relative h-full! items-start! rounded-none border-border bg-transparent px-6 py-5 text-foreground ring-0 transition-all after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:bg-foreground after:opacity-0 after:content-[\"\"] first:rounded-tl-md last:rounded-tr-md hover:bg-interactive-hover data-[state=active]:bg-transparent data-[state=active]:after:opacity-100 [&:not(:last-child)]:border-r [&[data-state=active]_[data-type=\"value\"]]:text-foreground',\n },\n controlShape: {\n rounded: '',\n pill: '',\n },\n },\n compoundVariants: [\n {\n variant: ['button', 'button-sm'],\n controlShape: 'pill',\n className: 'rounded-full',\n },\n ],\n defaultVariants: {\n variant: 'segmented',\n controlShape: 'rounded',\n },\n },\n);\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, onMouseDownCapture, ...props }, ref) => {\n const { variant, controlShape } = React.useContext(TabsContext);\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(tabsTriggerVariants({ variant, controlShape, className }))}\n onMouseDownCapture={(event) => {\n const activeElement = document.activeElement;\n if (\n activeElement instanceof HTMLElement &&\n activeElement.matches('input, textarea, select, [contenteditable=\"true\"]')\n ) {\n activeElement.blur();\n }\n onMouseDownCapture?.(event);\n }}\n {...props}\n />\n );\n});\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\ninterface TabsTriggerCountProps {\n children: React.ReactNode;\n className?: string;\n}\n\nconst TabsTriggerCount: React.FC<TabsTriggerCountProps> = ({ className = '', children }) => {\n return (\n <span\n className={cn(\n 'mt-px ml-1.5 flex h-5 items-center justify-center rounded-full bg-secondary px-1.5 py-0 text-xs leading-[21px] font-semibold text-text-secondary',\n className,\n )}\n >\n {children}\n </span>\n );\n};\nTabsTriggerCount.displayName = 'TabsTriggerCount';\n\nconst tabsContentVariants = cva(\n 'ring-offset-background focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:outline-hidden',\n {\n variants: {\n variant: {\n segmented: '',\n 'segmented-sm': '',\n button: '',\n 'button-sm': '',\n underline: '',\n navbar: '',\n pill: '',\n kpis: 'ring-0',\n },\n },\n defaultVariants: {\n variant: 'segmented',\n },\n },\n);\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => {\n const { variant } = React.useContext(TabsContext);\n return (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(tabsContentVariants({ variant, className }))}\n {...props}\n />\n );\n});\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\ninterface TabsDropdownTriggerProps extends Omit<\n React.ComponentProps<typeof TabsPrimitive.Trigger>,\n 'asChild'\n> {\n children: React.ReactNode;\n}\n\nconst TabsDropdownTrigger = React.forwardRef<HTMLButtonElement, TabsDropdownTriggerProps>(\n ({ children, className, ...props }, ref) => {\n const { variant, controlShape } = React.useContext(TabsContext);\n return (\n <div\n className={cn(\n 'relative rounded-control hover:bg-tab-hover',\n (variant === 'button' || variant === 'button-sm') &&\n controlShape === 'pill' &&\n 'rounded-full',\n )}\n >\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(tabsTriggerVariants({ variant, controlShape, className }))}\n {...props}\n >\n <div className=\"flex items-center gap-2\">{children}</div>\n </TabsPrimitive.Trigger>\n <DropdownMenuTrigger\n className=\"absolute inset-0 size-full cursor-pointer\"\n onClick={(e) => {\n // Stop propagation to prevent tab change\n e.preventDefault();\n }}\n />\n </div>\n );\n },\n);\nTabsDropdownTrigger.displayName = 'TabsDropdownTrigger';\n\nexport { Tabs, TabsList, TabsTrigger, TabsTriggerCount, TabsContent, TabsDropdownTrigger };\n"],"mappings":";;;;;;;;AAuBA,IAAM,cAAc,QAAM,cAAgC;CACxD,SAAS;CACT,cAAc;AAChB,CAAC;AAMD,IAAM,OAAO,QAAM,YAChB,EAAE,UA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MAAM;IAEd,EAAE,eAAe;GACnB;EACD,CAAA,CACE;;AAET,CACF;AACA,oBAAoB,cAAc"}
|
|
1
|
+
{"version":3,"file":"tabs.js","names":[],"sources":["../../../src/components/ui/tabs.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport { DropdownMenuTrigger } from './dropdown-menu';\nimport { Box } from '@/components/primitives/box';\n\nimport { cn } from '@/lib/utils';\nimport { cva } from 'class-variance-authority';\nimport { type ControlShape, useShade } from '@/providers/shade-context';\nimport { tabSurfaceVariants } from '@/components/ui/tabs-variants';\n\ntype TabsVariant =\n | 'segmented'\n | 'segmented-sm'\n | 'button'\n | 'button-sm'\n | 'underline'\n | 'navbar'\n | 'pill'\n | 'kpis';\n\ninterface TabsContextValue {\n variant: TabsVariant;\n controlShape: ControlShape;\n}\n\nconst TabsContext = React.createContext<TabsContextValue>({\n variant: 'segmented',\n controlShape: 'rounded',\n});\n\nexport interface TabsProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> {\n variant?: TabsVariant;\n}\n\nconst Tabs = React.forwardRef<React.ElementRef<typeof TabsPrimitive.Root>, TabsProps>(\n ({ variant, ...props }, ref) => {\n const { controlShape, admin7Design } = useShade();\n const resolvedVariant = variant ?? (admin7Design ? 'underline' : 'segmented');\n\n return (\n <TabsContext.Provider value={{ variant: resolvedVariant, controlShape }}>\n <TabsPrimitive.Root ref={ref} {...props} />\n </TabsContext.Provider>\n );\n },\n);\nTabs.displayName = TabsPrimitive.Root.displayName;\n\nconst tabsListVariants = cva('inline-flex items-center text-muted-foreground', {\n variants: {\n variant: {\n segmented: 'h-(--control-height) rounded-lg bg-muted px-[3px]',\n 'segmented-sm': 'h-8 rounded-lg bg-muted px-[3px]',\n button: 'gap-2',\n 'button-sm': 'gap-1',\n underline:\n 'no-scrollbar w-full max-w-full gap-5 overflow-x-auto border-b border-border-default',\n navbar: 'h-[52px] items-end gap-6',\n pill: '-ml-0.5 h-[30px] gap-px',\n // The `kpis` variant is consumed only by `features/kpi/kpi-tabs.tsx`.\n // Kept here so the cva variant set is in one place; not for direct use by app code.\n kpis: 'border-b ring-0',\n },\n admin7Design: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n {\n variant: 'underline',\n admin7Design: true,\n className: 'overflow-y-hidden border-b-0 inset-shadow-[0_-1px_0] inset-shadow-border-default',\n },\n {\n variant: ['button', 'button-sm'],\n admin7Design: true,\n className: 'no-scrollbar max-w-full overflow-x-auto',\n },\n ],\n defaultVariants: {\n variant: 'segmented',\n },\n});\n\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, children, style, ...props }, ref) => {\n const { variant } = React.useContext(TabsContext);\n const { admin7Design, admin7Mobile } = useShade();\n const listRef = React.useRef<HTMLDivElement | null>(null);\n const [mask, setMask] = React.useState<string>();\n const setRef = React.useCallback(\n (element: HTMLDivElement | null) => {\n listRef.current = element;\n if (typeof ref === 'function') {\n ref(element);\n } else if (ref) {\n ref.current = element;\n }\n },\n [ref],\n );\n\n React.useEffect(() => {\n const list = listRef.current;\n if (!admin7Mobile || !list) {\n return;\n }\n const update = () => {\n const maxScroll = list.scrollWidth - list.clientWidth;\n const left =\n getComputedStyle(list).direction === 'rtl'\n ? maxScroll - Math.abs(list.scrollLeft)\n : list.scrollLeft;\n const fadeLeft = left > 1;\n const fadeRight = maxScroll - left > 1;\n setMask(\n fadeLeft || fadeRight\n ? `linear-gradient(to right, ${fadeLeft ? 'transparent, black 24px' : 'black'}, ${fadeRight ? 'black calc(100% - 24px), transparent' : 'black'})`\n : undefined,\n );\n };\n update();\n const observer = new ResizeObserver(update);\n observer.observe(list);\n Array.from(list.children).forEach((child) => observer.observe(child));\n list.addEventListener('scroll', update, { passive: true });\n return () => {\n observer.disconnect();\n list.removeEventListener('scroll', update);\n };\n }, [admin7Mobile, children]);\n\n const solidDivider = admin7Mobile && variant === 'underline';\n const list = (\n <TabsPrimitive.List\n ref={setRef}\n className={cn(\n tabsListVariants({ variant, admin7Design }),\n admin7Mobile && mask && 'max-lg:[mask-image:var(--tabs-overflow-mask)]',\n solidDivider && 'max-lg:relative max-lg:border-b-transparent max-lg:inset-shadow-none',\n className,\n )}\n style={\n admin7Mobile && mask\n ? ({ ...style, '--tabs-overflow-mask': mask } as React.CSSProperties)\n : style\n }\n {...props}\n >\n {children}\n </TabsPrimitive.List>\n );\n return solidDivider ? (\n <Box className=\"contents max-lg:relative max-lg:block max-lg:before:pointer-events-none max-lg:before:absolute max-lg:before:inset-x-0 max-lg:before:bottom-0 max-lg:before:border-b max-lg:before:border-border-default\">\n {list}\n </Box>\n ) : (\n list\n );\n});\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst tabsTriggerVariants = cva(\n 'inline-flex items-center justify-center px-3 py-1 whitespace-nowrap ring-offset-background transition-all focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground [&_svg]:size-4 [&_svg]:shrink-0',\n {\n variants: {\n variant: {\n segmented:\n 'h-[calc(var(--control-height)-4px)] rounded-control text-control font-medium data-[state=active]:shadow-md',\n 'segmented-sm':\n 'h-[26px] rounded-control text-sm font-medium data-[state=active]:shadow-md',\n button:\n 'h-(--control-height) gap-1.5 rounded-control py-2 text-control font-medium hover:bg-tab-hover data-[state=active]:bg-tab-active data-[state=active]:hover:bg-tab-active',\n 'button-sm':\n 'h-6 gap-1.5 rounded-control p-2 text-sm font-medium text-text-secondary hover:bg-tab-hover data-[state=active]:bg-tab-active data-[state=active]:text-foreground data-[state=active]:hover:bg-tab-active',\n underline:\n 'relative h-9 px-0 text-control font-semibold text-text-secondary after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:bg-foreground after:opacity-0 after:content-[\"\"] hover:after:opacity-10 data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:after:opacity-100!',\n navbar:\n 'relative h-[52px] px-px text-control font-semibold text-muted-foreground after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:bg-foreground after:opacity-0 after:content-[\"\"] hover:text-foreground data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:after:opacity-100!',\n pill: 'relative h-[30px] rounded-md px-3 text-control font-medium text-text-secondary hover:bg-tab-hover hover:text-foreground data-[state=active]:bg-tab-active data-[state=active]:text-foreground data-[state=active]:hover:bg-tab-active',\n kpis: 'relative h-full! items-start! rounded-none border-border bg-transparent px-6 py-5 text-foreground ring-0 transition-all after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:bg-foreground after:opacity-0 after:content-[\"\"] first:rounded-tl-md last:rounded-tr-md hover:bg-interactive-hover data-[state=active]:bg-transparent data-[state=active]:after:opacity-100 [&:not(:last-child)]:border-r [&[data-state=active]_[data-type=\"value\"]]:text-foreground',\n },\n controlShape: {\n rounded: '',\n pill: '',\n },\n admin7Design: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n {\n variant: 'underline',\n admin7Design: true,\n className:\n 'h-auto py-2.5 text-control-lg font-normal data-[state=active]:font-semibold after:bottom-0 after:h-px',\n },\n {\n variant: ['button', 'button-sm'],\n controlShape: 'pill',\n className: 'rounded-full',\n },\n ],\n defaultVariants: {\n variant: 'segmented',\n controlShape: 'rounded',\n },\n },\n);\n\n// Reserve selected-weight text width without duplicating icons, badges or child components.\nfunction renderTabsTriggerLabel(children: React.ReactNode, asChild = false): React.ReactNode {\n if (children === null || children === undefined) {\n return children;\n }\n\n if (asChild && React.isValidElement<{ children?: React.ReactNode }>(children)) {\n return React.cloneElement(children, undefined, renderTabsTriggerLabel(children.props.children));\n }\n\n const sizedChildren = React.Children.map(children, (child) => {\n if (typeof child === 'string' || typeof child === 'number') {\n const label = typeof child === 'string' ? child.trim() : child;\n if (label === '') {\n return child;\n }\n\n // Keep boundary spaces in the inline flow between nested label elements.\n const leadingSpace = typeof child === 'string' ? child.match(/^\\s*/)?.[0] : undefined;\n const trailingSpace = typeof child === 'string' ? child.match(/\\s*$/)?.[0] : undefined;\n return (\n <>\n {leadingSpace}\n <span className=\"inline-grid\">\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none invisible col-start-1 row-start-1 font-semibold select-none\"\n >\n {label}\n </span>\n <span className=\"col-start-1 row-start-1\">{label}</span>\n </span>\n {trailingSpace}\n </>\n );\n }\n if (\n React.isValidElement<{ children?: React.ReactNode }>(child) &&\n (child.type === React.Fragment || (typeof child.type === 'string' && child.type !== 'svg'))\n ) {\n return React.cloneElement(child, undefined, renderTabsTriggerLabel(child.props.children));\n }\n return child;\n });\n\n const renderedChildren: React.ReactNode[] = [];\n let labelChildren: React.ReactNode[] = [];\n const flushLabel = () => {\n if (\n labelChildren.length > 1 &&\n labelChildren.some((child) => typeof child !== 'string' || child.trim())\n ) {\n // A single inline context preserves spaces between direct trigger children.\n renderedChildren.push(<span key={`label-${renderedChildren.length}`}>{labelChildren}</span>);\n } else {\n renderedChildren.push(...labelChildren);\n }\n labelChildren = [];\n };\n\n React.Children.toArray(sizedChildren).forEach((child) => {\n if (\n typeof child === 'string' ||\n typeof child === 'number' ||\n (React.isValidElement(child) &&\n (child.type === React.Fragment || (typeof child.type === 'string' && child.type !== 'svg')))\n ) {\n labelChildren.push(child);\n } else {\n flushLabel();\n renderedChildren.push(child);\n }\n });\n flushLabel();\n return renderedChildren;\n}\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ children, className, onMouseDownCapture, ...props }, ref) => {\n const { variant, controlShape } = React.useContext(TabsContext);\n const { admin7Design } = useShade();\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n tabsTriggerVariants({ variant, controlShape, admin7Design }),\n (variant === 'button' || variant === 'button-sm') &&\n tabSurfaceVariants({\n admin7Design,\n size: variant === 'button-sm' ? 'compact' : 'default',\n }),\n className,\n )}\n onMouseDownCapture={(event) => {\n const activeElement = document.activeElement;\n if (\n activeElement instanceof HTMLElement &&\n activeElement.matches('input, textarea, select, [contenteditable=\"true\"]')\n ) {\n activeElement.blur();\n }\n onMouseDownCapture?.(event);\n }}\n {...props}\n >\n {admin7Design && variant === 'underline'\n ? renderTabsTriggerLabel(children, props.asChild)\n : children}\n </TabsPrimitive.Trigger>\n );\n});\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\ninterface TabsTriggerCountProps {\n children: React.ReactNode;\n className?: string;\n}\n\nconst TabsTriggerCount: React.FC<TabsTriggerCountProps> = ({ className = '', children }) => {\n return (\n <span\n className={cn(\n 'mt-px ml-1.5 flex h-5 items-center justify-center rounded-full bg-secondary px-1.5 py-0 text-xs leading-[21px] font-semibold text-text-secondary',\n className,\n )}\n >\n {children}\n </span>\n );\n};\nTabsTriggerCount.displayName = 'TabsTriggerCount';\n\nconst tabsContentVariants = cva(\n 'ring-offset-background focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:outline-hidden',\n {\n variants: {\n variant: {\n segmented: '',\n 'segmented-sm': '',\n button: '',\n 'button-sm': '',\n underline: '',\n navbar: '',\n pill: '',\n kpis: 'ring-0',\n },\n },\n defaultVariants: {\n variant: 'segmented',\n },\n },\n);\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => {\n const { variant } = React.useContext(TabsContext);\n return (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(tabsContentVariants({ variant, className }))}\n {...props}\n />\n );\n});\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\ninterface TabsDropdownTriggerProps extends Omit<\n React.ComponentProps<typeof TabsPrimitive.Trigger>,\n 'asChild'\n> {\n children: React.ReactNode;\n}\n\nconst TabsDropdownTrigger = React.forwardRef<HTMLButtonElement, TabsDropdownTriggerProps>(\n ({ children, className, ...props }, ref) => {\n const { variant, controlShape } = React.useContext(TabsContext);\n const { admin7Design } = useShade();\n return (\n <div\n className={cn(\n 'relative rounded-control hover:bg-tab-hover',\n (variant === 'button' || variant === 'button-sm') &&\n controlShape === 'pill' &&\n 'rounded-full',\n )}\n >\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n tabsTriggerVariants({ variant, controlShape, admin7Design }),\n (variant === 'button' || variant === 'button-sm') &&\n tabSurfaceVariants({\n admin7Design,\n size: variant === 'button-sm' ? 'compact' : 'default',\n }),\n className,\n )}\n {...props}\n >\n <div className=\"flex items-center gap-2\">\n {admin7Design && variant === 'underline' ? renderTabsTriggerLabel(children) : children}\n </div>\n </TabsPrimitive.Trigger>\n <DropdownMenuTrigger\n className=\"absolute inset-0 size-full cursor-pointer\"\n onClick={(e) => {\n // Stop propagation to prevent tab change\n e.preventDefault();\n }}\n />\n </div>\n );\n },\n);\nTabsDropdownTrigger.displayName = 'TabsDropdownTrigger';\n\nexport { Tabs, TabsList, TabsTrigger, TabsTriggerCount, TabsContent, TabsDropdownTrigger };\n"],"mappings":";;;;;;;;;;AAyBA,IAAM,cAAc,QAAM,cAAgC;CACxD,SAAS;CACT,cAAc;AAChB,CAAC;AAMD,IAAM,OAAO,QAAM,YAChB,EAAE,SAAS,GAAG,SAAS,QAAQ;CAC9B,MAAM,EAAE,cAAc,iBAAiB,SAAS;CAChD,MAAM,kBAAkB,YAAY,eAAe,cAAc;CAEjE,OACE,oBAAC,YAAY,UAAb;EAAsB,OAAO;GAAE,SAAS;GAAiB;EAAa;YACpE,oBAAC,cAAc,MAAf;GAAyB;GAAK,GAAI;EAAQ,CAAA;CACtB,CAAA;AAE1B,CACF;AACA,KAAK,cAAc,cAAc,KAAK;AAEtC,IAAM,mBAAmB,IAAI,kDAAkD;CAC7E,UAAU;EACR,SAAS;GACP,WAAW;GACX,gBAAgB;GAChB,QAAQ;GACR,aAAa;GACb,WACE;GACF,QAAQ;G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AM,YAC/B,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,MAAM,EAAE,SAAS,iBAAiB,QAAM,WAAW,WAAW;CAC9D,MAAM,EAAE,iBAAiB,SAAS;CAClC,OACE,qBAAC,OAAD;EACE,WAAW,GACT,gDACC,YAAY,YAAY,YAAY,gBACnC,iBAAiB,UACjB,cACJ;YANF,CAQE,oBAAC,cAAc,SAAf;GACO;GACL,WAAW,GACT,oBAAoB;IAAE;IAAS;IAAc;GAAa,CAAC,IAC1D,YAAY,YAAY,YAAY,gBACnC,mBAAmB;IACjB;IACA,MAAM,YAAY,cAAc,YAAY;GAC9C,CAAC,GACH,SACF;GACA,GAAI;aAEJ,oBAAC,OAAD;IAAK,WAAU;cACZ,gBAAgB,YAAY,cAAc,uBAAuB,QAAQ,IAAI;GAC3E,CAAA;EACgB,CAAA,GACvB,oBAAC,qBAAD;GACE,WAAU;GACV,UAAU,MAAM;IAEd,EAAE,eAAe;GACnB;EACD,CAAA,CACE;;AAET,CACF;AACA,oBAAoB,cAAc"}
|
|
@@ -6,7 +6,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
6
6
|
var Textarea = React$1.forwardRef(({ className, ...props }, ref) => {
|
|
7
7
|
return /* @__PURE__ */ jsx("textarea", {
|
|
8
8
|
ref,
|
|
9
|
-
className: cn(inputSurface("self"), inputSurfaceClasses.disabledFieldSelf, "flex min-h-[80px] w-full max-w-none px-3 py-2 text-
|
|
9
|
+
className: cn(inputSurface("self"), inputSurfaceClasses.disabledFieldSelf, "flex min-h-[80px] w-full max-w-none px-3 py-2 text-(length:--text-field) placeholder:text-muted-foreground", className),
|
|
10
10
|
...props
|
|
11
11
|
});
|
|
12
12
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","names":[],"sources":["../../../src/components/ui/textarea.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { inputSurface, inputSurfaceClasses } from '@/components/ui/input-surface';\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<'textarea'>>(\n ({ className, ...props }, ref) => {\n return (\n <textarea\n ref={ref}\n className={cn(\n inputSurface('self'),\n inputSurfaceClasses.disabledFieldSelf,\n 'flex min-h-[80px] w-full max-w-none px-3 py-2 text-
|
|
1
|
+
{"version":3,"file":"textarea.js","names":[],"sources":["../../../src/components/ui/textarea.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { inputSurface, inputSurfaceClasses } from '@/components/ui/input-surface';\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<'textarea'>>(\n ({ className, ...props }, ref) => {\n return (\n <textarea\n ref={ref}\n className={cn(\n inputSurface('self'),\n inputSurfaceClasses.disabledFieldSelf,\n 'flex min-h-[80px] w-full max-w-none px-3 py-2 text-(length:--text-field) placeholder:text-muted-foreground',\n className,\n )}\n {...props}\n />\n );\n },\n);\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n"],"mappings":";;;;;AAKA,IAAM,WAAW,QAAM,YACpB,EAAE,WAAW,GAAG,SAAS,QAAQ;CAChC,OACE,oBAAC,YAAD;EACO;EACL,WAAW,GACT,aAAa,MAAM,GACnB,oBAAoB,mBACpB,8GACA,SACF;EACA,GAAI;CACL,CAAA;AAEL,CACF;AACA,SAAS,cAAc"}
|
|
@@ -10,7 +10,7 @@ var ToggleGroupContext = React$1.createContext({
|
|
|
10
10
|
variant: "default"
|
|
11
11
|
});
|
|
12
12
|
var ToggleGroup = React$1.forwardRef(({ className, variant, size, shape, children, ...props }, ref) => {
|
|
13
|
-
const { controlShape
|
|
13
|
+
const { controlShape } = useShade();
|
|
14
14
|
const resolvedShape = shape ?? controlShape;
|
|
15
15
|
return /* @__PURE__ */ jsx(ToggleGroupPrimitive.Root, {
|
|
16
16
|
ref,
|
|
@@ -21,7 +21,6 @@ var ToggleGroup = React$1.forwardRef(({ className, variant, size, shape, childre
|
|
|
21
21
|
value: {
|
|
22
22
|
variant,
|
|
23
23
|
size,
|
|
24
|
-
isAdmin7,
|
|
25
24
|
shape: resolvedShape
|
|
26
25
|
},
|
|
27
26
|
children
|
|
@@ -36,7 +35,6 @@ var ToggleGroupItem = React$1.forwardRef(({ className, children, variant, size,
|
|
|
36
35
|
ref,
|
|
37
36
|
className: cn(toggleVariants({
|
|
38
37
|
variant: context.variant || variant,
|
|
39
|
-
isAdmin7: context.isAdmin7,
|
|
40
38
|
size: context.size || size,
|
|
41
39
|
shape: resolvedShape
|
|
42
40
|
}), className),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-group.js","names":[],"sources":["../../../src/components/ui/toggle-group.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\nimport { toggleVariants } from '@/components/ui/toggle-variants';\nimport { useShade } from '@/providers/shade-context';\n\nconst ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({\n size: 'default',\n variant: 'default',\n});\n\nconst ToggleGroup = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &\n
|
|
1
|
+
{"version":3,"file":"toggle-group.js","names":[],"sources":["../../../src/components/ui/toggle-group.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\nimport { toggleVariants } from '@/components/ui/toggle-variants';\nimport { useShade } from '@/providers/shade-context';\n\nconst ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({\n size: 'default',\n variant: 'default',\n});\n\nconst ToggleGroup = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({ className, variant, size, shape, children, ...props }, ref) => {\n const { controlShape } = useShade();\n const resolvedShape = shape ?? controlShape;\n\n return (\n <ToggleGroupPrimitive.Root\n ref={ref}\n className={cn(\n 'inline-flex items-center justify-center gap-0.5 bg-muted p-0.5 dark:border dark:border-border dark:bg-background',\n resolvedShape === 'pill' ? 'rounded-full' : 'rounded-(--input-group-radius)',\n className,\n )}\n data-control-shape={resolvedShape}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size, shape: resolvedShape }}>\n {children}\n </ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n );\n});\n\nToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;\n\nconst ToggleGroupItem = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &\n VariantProps<typeof toggleVariants>\n>(({ className, children, variant, size, shape, ...props }, ref) => {\n const context = React.useContext(ToggleGroupContext);\n const resolvedShape = shape ?? context.shape;\n\n return (\n <ToggleGroupPrimitive.Item\n ref={ref}\n className={cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n shape: resolvedShape,\n }),\n className,\n )}\n data-control-shape={resolvedShape}\n {...props}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n});\n\nToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;\n\nexport { ToggleGroup, ToggleGroupItem };\n"],"mappings":";;;;;;;AAQA,IAAM,qBAAqB,QAAM,cAAmD;CAClF,MAAM;CACN,SAAS;AACX,CAAC;AAED,IAAM,cAAc,QAAM,YAIvB,EAAE,WAAW,SAAS,MAAM,OAAO,UAAU,GAAG,SAAS,QAAQ;CAClE,MAAM,EAAE,iBAAiB,SAAS;CAClC,MAAM,gBAAgB,SAAS;CAE/B,OACE,oBAAC,qBAAqB,MAAtB;EACO;EACL,WAAW,GACT,oHACA,kBAAkB,SAAS,iBAAiB,kCAC5C,SACF;EACA,sBAAoB;EACpB,GAAI;YAEJ,oBAAC,mBAAmB,UAApB;GAA6B,OAAO;IAAE;IAAS;IAAM,OAAO;GAAc;GACvE;EAC0B,CAAA;CACJ,CAAA;AAE/B,CAAC;AAED,YAAY,cAAc,qBAAqB,KAAK;AAEpD,IAAM,kBAAkB,QAAM,YAI3B,EAAE,WAAW,UAAU,SAAS,MAAM,OAAO,GAAG,SAAS,QAAQ;CAClE,MAAM,UAAU,QAAM,WAAW,kBAAkB;CACnD,MAAM,gBAAgB,SAAS,QAAQ;CAEvC,OACE,oBAAC,qBAAqB,MAAtB;EACO;EACL,WAAW,GACT,eAAe;GACb,SAAS,QAAQ,WAAW;GAC5B,MAAM,QAAQ,QAAQ;GACtB,OAAO;EACT,CAAC,GACD,SACF;EACA,sBAAoB;EACpB,GAAI;EAEH;CACwB,CAAA;AAE/B,CAAC;AAED,gBAAgB,cAAc,qBAAqB,KAAK"}
|
|
@@ -7,25 +7,19 @@ var toggleVariants = cva("inline-flex items-center justify-center gap-2 text-con
|
|
|
7
7
|
default: "h-[calc(var(--control-height)-2px)] min-w-[26px] px-2",
|
|
8
8
|
button: "h-[calc(var(--control-height)-2px)] min-w-[32px] px-3"
|
|
9
9
|
},
|
|
10
|
-
isAdmin7: {
|
|
11
|
-
true: "",
|
|
12
|
-
false: ""
|
|
13
|
-
},
|
|
14
10
|
shape: {
|
|
15
11
|
rounded: "rounded-control",
|
|
16
12
|
pill: "rounded-full"
|
|
17
13
|
}
|
|
18
14
|
},
|
|
19
15
|
compoundVariants: [{
|
|
20
|
-
isAdmin7: true,
|
|
21
16
|
size: ["default", "button"],
|
|
22
17
|
className: "h-[calc(var(--control-height)-4px)] data-[state=off]:hover:bg-transparent"
|
|
23
18
|
}],
|
|
24
19
|
defaultVariants: {
|
|
25
20
|
variant: "default",
|
|
26
21
|
size: "default",
|
|
27
|
-
shape: "pill"
|
|
28
|
-
isAdmin7: true
|
|
22
|
+
shape: "pill"
|
|
29
23
|
}
|
|
30
24
|
});
|
|
31
25
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-variants.js","names":[],"sources":["../../../src/components/ui/toggle-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst toggleVariants = cva(\n 'inline-flex items-center justify-center gap-2 text-control font-medium text-text-secondary transition-colors hover:bg-surface-elevated hover:text-foreground focus-visible:ring-1 focus-visible:ring-focus-ring focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm dark:data-[state=on]:bg-tab-active [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]',\n {\n variants: {\n variant: {\n default: 'bg-transparent',\n },\n size: {\n default: 'h-[calc(var(--control-height)-2px)] min-w-[26px] px-2',\n button: 'h-[calc(var(--control-height)-2px)] min-w-[32px] px-3',\n },\n
|
|
1
|
+
{"version":3,"file":"toggle-variants.js","names":[],"sources":["../../../src/components/ui/toggle-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst toggleVariants = cva(\n 'inline-flex items-center justify-center gap-2 text-control font-medium text-text-secondary transition-colors hover:bg-surface-elevated hover:text-foreground focus-visible:ring-1 focus-visible:ring-focus-ring focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm dark:data-[state=on]:bg-tab-active [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]',\n {\n variants: {\n variant: {\n default: 'bg-transparent',\n },\n size: {\n default: 'h-[calc(var(--control-height)-2px)] min-w-[26px] px-2',\n button: 'h-[calc(var(--control-height)-2px)] min-w-[32px] px-3',\n },\n shape: {\n rounded: 'rounded-control',\n pill: 'rounded-full',\n },\n },\n compoundVariants: [\n {\n size: ['default', 'button'],\n className: 'h-[calc(var(--control-height)-4px)] data-[state=off]:hover:bg-transparent',\n },\n ],\n defaultVariants: {\n variant: 'default',\n size: 'default',\n shape: 'pill',\n },\n },\n);\n\nexport { toggleVariants };\n"],"mappings":";;AAEA,IAAM,iBAAiB,IACrB,+eACA;CACE,UAAU;EACR,SAAS,EACP,SAAS,iBACX;EACA,MAAM;GACJ,SAAS;GACT,QAAQ;EACV;EACA,OAAO;GACL,SAAS;GACT,MAAM;EACR;CACF;CACA,kBAAkB,CAChB;EACE,MAAM,CAAC,WAAW,QAAQ;EAC1B,WAAW;CACb,CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;EACN,OAAO;CACT;AACF,CACF"}
|
|
@@ -7,14 +7,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
8
8
|
//#region src/components/ui/toggle.tsx
|
|
9
9
|
var Toggle = React$1.forwardRef(({ className, variant, size, shape, ...props }, ref) => {
|
|
10
|
-
const { controlShape
|
|
10
|
+
const { controlShape } = useShade();
|
|
11
11
|
const resolvedShape = shape ?? controlShape;
|
|
12
12
|
return /* @__PURE__ */ jsx(TogglePrimitive.Root, {
|
|
13
13
|
ref,
|
|
14
14
|
className: cn(toggleVariants({
|
|
15
15
|
variant,
|
|
16
16
|
size,
|
|
17
|
-
isAdmin7,
|
|
18
17
|
shape: resolvedShape,
|
|
19
18
|
className
|
|
20
19
|
})),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.js","names":[],"sources":["../../../src/components/ui/toggle.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport { toggleVariants } from '@/components/ui/toggle-variants';\nimport { cn } from '@/lib/utils';\nimport { useShade } from '@/providers/shade-context';\n\nconst Toggle = React.forwardRef<\n React.ElementRef<typeof TogglePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root>
|
|
1
|
+
{"version":3,"file":"toggle.js","names":[],"sources":["../../../src/components/ui/toggle.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport { toggleVariants } from '@/components/ui/toggle-variants';\nimport { cn } from '@/lib/utils';\nimport { useShade } from '@/providers/shade-context';\n\nconst Toggle = React.forwardRef<\n React.ElementRef<typeof TogglePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>\n>(({ className, variant, size, shape, ...props }, ref) => {\n const { controlShape } = useShade();\n const resolvedShape = shape ?? controlShape;\n\n return (\n <TogglePrimitive.Root\n ref={ref}\n className={cn(toggleVariants({ variant, size, shape: resolvedShape, className }))}\n data-control-shape={resolvedShape}\n {...props}\n />\n );\n});\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle };\n"],"mappings":";;;;;;;;AAUA,IAAM,SAAS,QAAM,YAGlB,EAAE,WAAW,SAAS,MAAM,OAAO,GAAG,SAAS,QAAQ;CACxD,MAAM,EAAE,iBAAiB,SAAS;CAClC,MAAM,gBAAgB,SAAS;CAE/B,OACE,oBAAC,gBAAgB,MAAjB;EACO;EACL,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM,OAAO;GAAe;EAAU,CAAC,CAAC;EAChF,sBAAoB;EACpB,GAAI;CACL,CAAA;AAEL,CAAC;AAED,OAAO,cAAc,gBAAgB,KAAK"}
|
|
@@ -3,9 +3,9 @@ import { inputSurface } from "./input-surface.js";
|
|
|
3
3
|
//#region src/components/ui/token-field.ts
|
|
4
4
|
/** Shared chip density for token inputs such as labels, tags and authors. */
|
|
5
5
|
var tokenFieldClasses = {
|
|
6
|
-
field: cn(inputSurface("within"), "relative flex min-h-(--control-height) w-full cursor-text flex-wrap items-center gap-1 p-0.75 text-
|
|
7
|
-
input: "min-w-20 flex-1 bg-transparent px-2 text-
|
|
8
|
-
chip: "h-auto min-h-6 max-w-full cursor-pointer gap-1 rounded-xl border-transparent px-2 py-0.75 pr-1.5 text-left text-sm leading-4 whitespace-normal",
|
|
6
|
+
field: cn(inputSurface("within"), "relative flex min-h-(--control-height) w-full cursor-text flex-wrap items-center gap-1 p-0.75 text-(length:--text-field)"),
|
|
7
|
+
input: "min-w-20 flex-1 bg-transparent px-2 text-(length:--text-field) outline-hidden placeholder:text-muted-foreground",
|
|
8
|
+
chip: "h-auto min-h-6 max-w-full cursor-pointer gap-1 rounded-xl border-transparent bg-field-chip-surface px-2 py-0.75 pr-1.5 text-left text-sm leading-4 whitespace-normal disabled:cursor-not-allowed disabled:text-muted-foreground",
|
|
9
9
|
chevron: "pointer-events-none absolute top-[calc((var(--control-height)-var(--spacing)*4)/2-1px)] right-1.5 size-4 text-muted-foreground"
|
|
10
10
|
};
|
|
11
11
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-field.js","names":[],"sources":["../../../src/components/ui/token-field.ts"],"sourcesContent":["import { inputSurface } from '@/components/ui/input-surface';\nimport { cn } from '@/lib/utils';\n\n/** Shared chip density for token inputs such as labels, tags and authors. */\nexport const tokenFieldClasses = {\n field: cn(\n inputSurface('within'),\n 'relative flex min-h-(--control-height) w-full cursor-text flex-wrap items-center gap-1 p-0.75 text-
|
|
1
|
+
{"version":3,"file":"token-field.js","names":[],"sources":["../../../src/components/ui/token-field.ts"],"sourcesContent":["import { inputSurface } from '@/components/ui/input-surface';\nimport { cn } from '@/lib/utils';\n\n/** Shared chip density for token inputs such as labels, tags and authors. */\nexport const tokenFieldClasses = {\n field: cn(\n inputSurface('within'),\n 'relative flex min-h-(--control-height) w-full cursor-text flex-wrap items-center gap-1 p-0.75 text-(length:--text-field)',\n ),\n input:\n 'min-w-20 flex-1 bg-transparent px-2 text-(length:--text-field) outline-hidden placeholder:text-muted-foreground',\n // 24px on one line; long names wrap.\n chip: 'h-auto min-h-6 max-w-full cursor-pointer gap-1 rounded-xl border-transparent bg-field-chip-surface px-2 py-0.75 pr-1.5 text-left text-sm leading-4 whitespace-normal disabled:cursor-not-allowed disabled:text-muted-foreground',\n // Matches Select's chevron; offsets start inside the 1px border.\n chevron:\n 'pointer-events-none absolute top-[calc((var(--control-height)-var(--spacing)*4)/2-1px)] right-1.5 size-4 text-muted-foreground',\n} as const;\n"],"mappings":";;;;AAIA,IAAa,oBAAoB;CAC/B,OAAO,GACL,aAAa,QAAQ,GACrB,0HACF;CACA,OACE;CAEF,MAAM;CAEN,SACE;AACJ"}
|