@alepha/ui 0.36.1 → 0.37.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/dist/account/$pageAccount.d.ts +1 -1
- package/dist/account/$pageAccount.d.ts.map +1 -1
- package/dist/account/$pageAccount.js.map +1 -1
- package/dist/account/AccountDisplay.d.ts +13 -0
- package/dist/account/AccountDisplay.d.ts.map +1 -0
- package/dist/account/AccountDisplay.js +48 -0
- package/dist/account/AccountDisplay.js.map +1 -0
- package/dist/account/AccountProfile.d.ts.map +1 -1
- package/dist/account/AccountProfile.js +14 -10
- package/dist/account/AccountProfile.js.map +1 -1
- package/dist/account/AccountRouter.d.ts +6 -6
- package/dist/account/AccountRouter.d.ts.map +1 -1
- package/dist/account/index.d.ts +5 -0
- package/dist/account/index.d.ts.map +1 -1
- package/dist/account/index.js +2 -1
- package/dist/admin/$pageAdmin.d.ts +1 -1
- package/dist/admin/$pageAdmin.d.ts.map +1 -1
- package/dist/admin/$pageAdmin.js.map +1 -1
- package/dist/admin/AdminAudits.js.map +1 -1
- package/dist/admin/AdminJobDetail.js.map +1 -1
- package/dist/admin/AdminJobs.js.map +1 -1
- package/dist/admin/AdminNotifications.js.map +1 -1
- package/dist/admin/AdminRouter.d.ts +14 -14
- package/dist/admin/AdminRouter.d.ts.map +1 -1
- package/dist/admin/AdminUserDetail.js.map +1 -1
- package/dist/admin/AdminUsers.js.map +1 -1
- package/dist/admin/ParameterHistoryItem.js.map +1 -1
- package/dist/ai/AiChat.d.ts +26 -39
- package/dist/ai/AiChat.d.ts.map +1 -1
- package/dist/ai/AiChat.js +65 -123
- package/dist/ai/AiChat.js.map +1 -1
- package/dist/ai/AiChatDock.d.ts +23 -0
- package/dist/ai/AiChatDock.d.ts.map +1 -0
- package/dist/ai/AiChatDock.js +90 -0
- package/dist/ai/AiChatDock.js.map +1 -0
- package/dist/ai/AiChatDockSlot.d.ts +15 -0
- package/dist/ai/AiChatDockSlot.d.ts.map +1 -0
- package/dist/ai/AiChatDockSlot.js +20 -0
- package/dist/ai/AiChatDockSlot.js.map +1 -0
- package/dist/ai/AiChatLauncher.d.ts +17 -0
- package/dist/ai/AiChatLauncher.d.ts.map +1 -0
- package/dist/ai/AiChatLauncher.js +42 -0
- package/dist/ai/AiChatLauncher.js.map +1 -0
- package/dist/ai/AiChatMessage.d.ts +6 -0
- package/dist/ai/AiChatMessage.d.ts.map +1 -1
- package/dist/ai/AiChatMessage.js +20 -4
- package/dist/ai/AiChatMessage.js.map +1 -1
- package/dist/ai/AiChatPanel.d.ts +71 -0
- package/dist/ai/AiChatPanel.d.ts.map +1 -0
- package/dist/ai/AiChatPanel.js +143 -0
- package/dist/ai/AiChatPanel.js.map +1 -0
- package/dist/ai/index.d.ts +8 -4
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +5 -1
- package/dist/ai/useAiChat.d.ts +12 -0
- package/dist/ai/useAiChat.d.ts.map +1 -1
- package/dist/ai/useAiChat.js +32 -15
- package/dist/ai/useAiChat.js.map +1 -1
- package/dist/auth/AuthLogin.d.ts +9 -0
- package/dist/auth/AuthLogin.d.ts.map +1 -1
- package/dist/auth/AuthLogin.js +2 -2
- package/dist/auth/AuthLogin.js.map +1 -1
- package/dist/auth/AuthRegister.d.ts +4 -1
- package/dist/auth/AuthRegister.d.ts.map +1 -1
- package/dist/auth/AuthRegister.js +1 -1
- package/dist/auth/AuthRegister.js.map +1 -1
- package/dist/auth/AuthResetPassword.d.ts +8 -0
- package/dist/auth/AuthResetPassword.d.ts.map +1 -1
- package/dist/auth/AuthResetPassword.js +2 -2
- package/dist/auth/AuthResetPassword.js.map +1 -1
- package/dist/auth/AuthRouter.d.ts +4 -4
- package/dist/auth/AuthRouter.d.ts.map +1 -1
- package/dist/core/Badge.d.ts.map +1 -1
- package/dist/core/Badge.js +7 -3
- package/dist/core/Badge.js.map +1 -1
- package/dist/core/Collapsible.d.ts +50 -0
- package/dist/core/Collapsible.d.ts.map +1 -0
- package/dist/core/Collapsible.js +70 -0
- package/dist/core/Collapsible.js.map +1 -0
- package/dist/core/Combobox.d.ts +7 -1
- package/dist/core/Combobox.d.ts.map +1 -1
- package/dist/core/Combobox.js +2 -2
- package/dist/core/Combobox.js.map +1 -1
- package/dist/core/PaneRail.d.ts +24 -7
- package/dist/core/PaneRail.d.ts.map +1 -1
- package/dist/core/PaneRail.js +24 -19
- package/dist/core/PaneRail.js.map +1 -1
- package/dist/core/Stepper.d.ts +36 -0
- package/dist/core/Stepper.d.ts.map +1 -0
- package/dist/core/Stepper.js +54 -0
- package/dist/core/Stepper.js.map +1 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -1
- package/dist/core/useToast.js +13 -13
- package/dist/core/useToast.js.map +1 -1
- package/dist/form/AutoForm.d.ts.map +1 -1
- package/dist/form/AutoForm.js +29 -0
- package/dist/form/AutoForm.js.map +1 -1
- package/dist/form/AutoFormErrorPopover.js +13 -3
- package/dist/form/AutoFormErrorPopover.js.map +1 -1
- package/dist/form/Control.d.ts +14 -1
- package/dist/form/Control.d.ts.map +1 -1
- package/dist/form/Control.js +12 -2
- package/dist/form/Control.js.map +1 -1
- package/dist/form/ControlDate.d.ts.map +1 -1
- package/dist/form/ControlDate.js +3 -0
- package/dist/form/ControlDate.js.map +1 -1
- package/dist/form/ControlDateRange.d.ts +12 -1
- package/dist/form/ControlDateRange.d.ts.map +1 -1
- package/dist/form/ControlDateRange.js +11 -1
- package/dist/form/ControlDateRange.js.map +1 -1
- package/dist/form/ControlNumber.d.ts.map +1 -1
- package/dist/form/ControlNumber.js +2 -0
- package/dist/form/ControlNumber.js.map +1 -1
- package/dist/form/ControlObject.d.ts.map +1 -1
- package/dist/form/ControlObject.js +15 -1
- package/dist/form/ControlObject.js.map +1 -1
- package/dist/form/ControlPassword.d.ts +4 -0
- package/dist/form/ControlPassword.d.ts.map +1 -1
- package/dist/form/ControlPassword.js +1 -0
- package/dist/form/ControlPassword.js.map +1 -1
- package/dist/form/ControlSelect.d.ts +23 -1
- package/dist/form/ControlSelect.d.ts.map +1 -1
- package/dist/form/ControlSelect.js +5 -0
- package/dist/form/ControlSelect.js.map +1 -1
- package/dist/form/ControlSelectCombobox.d.ts +11 -1
- package/dist/form/ControlSelectCombobox.d.ts.map +1 -1
- package/dist/form/ControlSelectCombobox.js +9 -1
- package/dist/form/ControlSelectCombobox.js.map +1 -1
- package/dist/form/ControlUpload.d.ts.map +1 -1
- package/dist/form/ControlUpload.js +1 -0
- package/dist/form/ControlUpload.js.map +1 -1
- package/dist/form/FormField.d.ts +5 -0
- package/dist/form/FormField.d.ts.map +1 -1
- package/dist/form/FormField.js +7 -0
- package/dist/form/FormField.js.map +1 -1
- package/dist/i18n/fr/uiFr.d.ts.map +1 -1
- package/dist/i18n/fr/uiFr.js +14 -0
- package/dist/i18n/fr/uiFr.js.map +1 -1
- package/dist/shell/$pageNav.d.ts +2 -2
- package/dist/shell/$pageNav.d.ts.map +1 -1
- package/dist/shell/$pageNav.js.map +1 -1
- package/dist/shell/AppShell.d.ts +6 -0
- package/dist/shell/AppShell.d.ts.map +1 -1
- package/dist/shell/AppShell.js +31 -27
- package/dist/shell/AppShell.js.map +1 -1
- package/dist/shell/ButtonSettings.d.ts +6 -2
- package/dist/shell/ButtonSettings.d.ts.map +1 -1
- package/dist/shell/ButtonSettings.js +17 -3
- package/dist/shell/ButtonSettings.js.map +1 -1
- package/dist/shell/ButtonSettingsVisionMenuItem.d.ts +16 -0
- package/dist/shell/ButtonSettingsVisionMenuItem.d.ts.map +1 -0
- package/dist/shell/ButtonSettingsVisionMenuItem.js +24 -0
- package/dist/shell/ButtonSettingsVisionMenuItem.js.map +1 -0
- package/dist/shell/ButtonVision.d.ts +28 -0
- package/dist/shell/ButtonVision.d.ts.map +1 -0
- package/dist/shell/ButtonVision.js +46 -0
- package/dist/shell/ButtonVision.js.map +1 -0
- package/dist/shell/index.d.ts +6 -3
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +2 -1
- package/dist/styles.css +57 -0
- package/dist/table/DataTable.d.ts.map +1 -1
- package/dist/table/DataTable.js +29 -4
- package/dist/table/DataTable.js.map +1 -1
- package/dist/table/DataTableColumnPicker.d.ts.map +1 -1
- package/dist/table/DataTableColumnPicker.js +1 -0
- package/dist/table/DataTableColumnPicker.js.map +1 -1
- package/dist/table/DataTableFilterBar.d.ts +1 -1
- package/dist/table/DataTableFilterBar.d.ts.map +1 -1
- package/dist/table/DataTableFilterBar.js +5 -108
- package/dist/table/DataTableFilterBar.js.map +1 -1
- package/dist/table/DataTableHeaderFilter.d.ts +51 -0
- package/dist/table/DataTableHeaderFilter.d.ts.map +1 -0
- package/dist/table/DataTableHeaderFilter.js +113 -0
- package/dist/table/DataTableHeaderFilter.js.map +1 -0
- package/dist/table/DataTableHeaderRow.d.ts +7 -0
- package/dist/table/DataTableHeaderRow.d.ts.map +1 -1
- package/dist/table/DataTableHeaderRow.js +92 -74
- package/dist/table/DataTableHeaderRow.js.map +1 -1
- package/dist/table/DataTableTabs.d.ts +42 -0
- package/dist/table/DataTableTabs.d.ts.map +1 -0
- package/dist/table/DataTableTabs.js +55 -0
- package/dist/table/DataTableTabs.js.map +1 -0
- package/dist/table/dataTableBaseProps.d.ts +12 -0
- package/dist/table/dataTableBaseProps.d.ts.map +1 -1
- package/dist/table/dataTablePersistence.d.ts.map +1 -1
- package/dist/table/dataTablePersistence.js +4 -2
- package/dist/table/dataTablePersistence.js.map +1 -1
- package/dist/table/dataTableTypes.d.ts +18 -0
- package/dist/table/dataTableTypes.d.ts.map +1 -1
- package/dist/table/index.d.ts +5 -2
- package/dist/table/index.d.ts.map +1 -1
- package/dist/table/index.js +2 -1
- package/dist/table/useDataTableColumns.d.ts.map +1 -1
- package/dist/table/useDataTableColumns.js +1 -0
- package/dist/table/useDataTableColumns.js.map +1 -1
- package/dist/table/useDataTableFilterModel.d.ts +110 -0
- package/dist/table/useDataTableFilterModel.d.ts.map +1 -0
- package/dist/table/useDataTableFilterModel.js +154 -0
- package/dist/table/useDataTableFilterModel.js.map +1 -0
- package/docs/packages-alepha-ui-account.md +4 -0
- package/docs/packages-alepha-ui-ai.md +5 -5
- package/docs/packages-alepha-ui-shell.md +4 -3
- package/docs/packages-alepha-ui-table.md +4 -2
- package/package.json +8 -8
- package/src/account/$pageAccount.tsx +5 -4
- package/src/account/AccountDisplay.tsx +58 -0
- package/src/account/AccountProfile.tsx +30 -42
- package/src/account/__tests__/AccountProfile.browser.spec.tsx +141 -0
- package/src/account/__tests__/AccountRecoveryCodes.browser.spec.tsx +1 -1
- package/src/account/index.ts +5 -0
- package/src/admin/$pageAdmin.tsx +5 -4
- package/src/admin/AdminAudits.tsx +1 -1
- package/src/admin/AdminJobDetail.tsx +1 -1
- package/src/admin/AdminJobs.tsx +1 -1
- package/src/admin/AdminNotifications.tsx +1 -1
- package/src/admin/AdminUserDetail.tsx +1 -1
- package/src/admin/AdminUsers.tsx +1 -1
- package/src/admin/ParameterHistoryItem.tsx +1 -1
- package/src/admin/__tests__/AdminFilesUsageCard.browser.spec.tsx +17 -9
- package/src/ai/AiChat.tsx +94 -183
- package/src/ai/AiChatDock.tsx +129 -0
- package/src/ai/AiChatDockSlot.tsx +23 -0
- package/src/ai/AiChatLauncher.tsx +58 -0
- package/src/ai/AiChatMessage.tsx +36 -2
- package/src/ai/AiChatPanel.tsx +252 -0
- package/src/ai/__tests__/AiChat.browser.spec.tsx +187 -5
- package/src/ai/index.ts +8 -4
- package/src/ai/useAiChat.ts +63 -14
- package/src/auth/AuthLogin.tsx +19 -4
- package/src/auth/AuthRegister.tsx +6 -3
- package/src/auth/AuthResetPassword.tsx +18 -8
- package/src/auth/__tests__/AuthCancel.browser.spec.tsx +129 -0
- package/src/core/Badge.tsx +7 -3
- package/src/core/Collapsible.tsx +95 -0
- package/src/core/Combobox.tsx +11 -3
- package/src/core/PaneRail.tsx +36 -20
- package/src/core/Stepper.tsx +118 -0
- package/src/core/__tests__/Badge.browser.spec.tsx +5 -5
- package/src/core/__tests__/Collapsible.browser.spec.tsx +88 -0
- package/src/core/__tests__/PaneRail.browser.spec.tsx +48 -0
- package/src/core/__tests__/Stepper.browser.spec.tsx +39 -0
- package/src/core/__tests__/primitiveSlots.spec.ts +7 -0
- package/src/core/index.ts +15 -0
- package/src/form/AutoForm.tsx +32 -0
- package/src/form/AutoFormErrorPopover.tsx +27 -6
- package/src/form/Control.tsx +22 -0
- package/src/form/ControlDate.tsx +3 -0
- package/src/form/ControlDateRange.tsx +87 -58
- package/src/form/ControlNumber.tsx +2 -0
- package/src/form/ControlObject.tsx +20 -1
- package/src/form/ControlPassword.tsx +5 -0
- package/src/form/ControlSelect.tsx +32 -1
- package/src/form/ControlSelectCombobox.tsx +82 -56
- package/src/form/ControlUpload.tsx +1 -0
- package/src/form/FormField.tsx +23 -1
- package/src/form/__tests__/ControlFieldErrors.browser.spec.tsx +253 -0
- package/src/form/__tests__/ControlValidateMode.browser.spec.tsx +217 -0
- package/src/form/__tests__/ControlVariantErrors.browser.spec.tsx +133 -0
- package/src/i18n/fr/uiFr.ts +18 -1
- package/src/markdown/css.d.ts +11 -0
- package/src/shell/$pageNav.tsx +6 -4
- package/src/shell/AppShell.tsx +7 -0
- package/src/shell/ButtonSettings.tsx +20 -5
- package/src/shell/ButtonSettingsVisionMenuItem.tsx +40 -0
- package/src/shell/ButtonVision.tsx +73 -0
- package/src/shell/__tests__/ButtonSettings.browser.spec.tsx +42 -2
- package/src/shell/__tests__/ButtonVision.browser.spec.tsx +73 -0
- package/src/shell/__tests__/visionTokens.spec.ts +104 -0
- package/src/shell/index.ts +6 -3
- package/src/styles.css +57 -0
- package/src/table/DataTable.tsx +52 -4
- package/src/table/DataTableColumnPicker.tsx +3 -0
- package/src/table/DataTableFilterBar.tsx +18 -191
- package/src/table/DataTableHeaderFilter.tsx +156 -0
- package/src/table/DataTableHeaderRow.tsx +78 -40
- package/src/table/DataTableTabs.tsx +114 -0
- package/src/table/__tests__/DataTableHeaderFilter.browser.spec.tsx +174 -0
- package/src/table/__tests__/DataTableStaleColumns.browser.spec.tsx +80 -0
- package/src/table/__tests__/DataTableTabs.browser.spec.tsx +72 -0
- package/src/table/dataTableBaseProps.ts +12 -0
- package/src/table/dataTablePersistence.ts +11 -5
- package/src/table/dataTableTypes.ts +18 -0
- package/src/table/index.ts +9 -2
- package/src/table/useDataTableColumns.ts +1 -0
- package/src/table/useDataTableFilterModel.tsx +240 -0
|
@@ -157,7 +157,7 @@ export declare class AuthRouter {
|
|
|
157
157
|
}[];
|
|
158
158
|
captchaSiteKey?: string | undefined;
|
|
159
159
|
};
|
|
160
|
-
}, import("alepha/react/router").TPropsParentDefault>;
|
|
160
|
+
}, import("alepha/react/router").TPropsParentDefault, "login">;
|
|
161
161
|
register: import("alepha/react/router").PagePrimitive<import("alepha/react/router").PageConfigSchema, {
|
|
162
162
|
realmConfig: {
|
|
163
163
|
settings: {
|
|
@@ -206,7 +206,7 @@ export declare class AuthRouter {
|
|
|
206
206
|
}[];
|
|
207
207
|
captchaSiteKey?: string | undefined;
|
|
208
208
|
};
|
|
209
|
-
}, import("alepha/react/router").TPropsParentDefault>;
|
|
209
|
+
}, import("alepha/react/router").TPropsParentDefault, "register">;
|
|
210
210
|
resetPassword: import("alepha/react/router").PagePrimitive<import("alepha/react/router").PageConfigSchema, {
|
|
211
211
|
realmConfig: {
|
|
212
212
|
settings: {
|
|
@@ -255,11 +255,11 @@ export declare class AuthRouter {
|
|
|
255
255
|
}[];
|
|
256
256
|
captchaSiteKey?: string | undefined;
|
|
257
257
|
};
|
|
258
|
-
}, import("alepha/react/router").TPropsParentDefault>;
|
|
258
|
+
}, import("alepha/react/router").TPropsParentDefault, "resetPassword">;
|
|
259
259
|
/**
|
|
260
260
|
* Reached from a link in an email, so it takes its `email` and `token` from the
|
|
261
261
|
* query string rather than from any state the browser already holds.
|
|
262
262
|
*/
|
|
263
|
-
verifyEmail: import("alepha/react/router").PagePrimitive<import("alepha/react/router").PageConfigSchema, any, import("alepha/react/router").TPropsParentDefault>;
|
|
263
|
+
verifyEmail: import("alepha/react/router").PagePrimitive<import("alepha/react/router").PageConfigSchema, any, import("alepha/react/router").TPropsParentDefault, "verifyEmail">;
|
|
264
264
|
}
|
|
265
265
|
//# sourceMappingURL=AuthRouter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthRouter.d.ts","sourceRoot":"","sources":["../../src/auth/AuthRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,qBAAa,UAAU;IACrB,SAAS,CAAC,QAAQ,CAAC,QAAQ,mEAA8B;IAEzD;;;OAGG;IACH,SAAS,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAEhB;IAEH;;;;OAIG;IACH,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"AuthRouter.d.ts","sourceRoot":"","sources":["../../src/auth/AuthRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,qBAAa,UAAU;IACrB,SAAS,CAAC,QAAQ,CAAC,QAAQ,mEAA8B;IAEzD;;;OAGG;IACH,SAAS,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAEhB;IAEH;;;;OAIG;IACH,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mEAYF;IAEH,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sEAYL;IAEH,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2EAWV;IAEH;;;OAGG;IACH,WAAW,qKAKR;CACJ"}
|
package/dist/core/Badge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/core/Badge.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,aAAa;;;
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/core/Badge.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,aAAa;;;8EAuFlB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,GACvD,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAErC,QAAA,MAAM,KAAK,UAAW,UAAU,+FAiB/B,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEhF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/core/Badge.js
CHANGED
|
@@ -41,6 +41,10 @@ const badgeVariants = cva("group/badge focus-visible:border-ring focus-visible:r
|
|
|
41
41
|
* would fight them: before this was enforced, a `default` badge given a
|
|
42
42
|
* tone lost its primary fill to the tone's wash, since tailwind-merge
|
|
43
43
|
* keeps the last `bg-*`.
|
|
44
|
+
*
|
|
45
|
+
* success, warning and danger paint from the signal tokens, not fixed
|
|
46
|
+
* Tailwind hues, so colour-blind mode (`:root.cvd`) repaints them.
|
|
47
|
+
* info stays blue: blue is already safe under every common deficiency.
|
|
44
48
|
*/
|
|
45
49
|
tone: {
|
|
46
50
|
neutral: "",
|
|
@@ -64,17 +68,17 @@ const badgeVariants = cva("group/badge focus-visible:border-ring focus-visible:r
|
|
|
64
68
|
{
|
|
65
69
|
variant: "tint",
|
|
66
70
|
tone: "success",
|
|
67
|
-
class: "border-
|
|
71
|
+
class: "border-success/40 bg-success/15"
|
|
68
72
|
},
|
|
69
73
|
{
|
|
70
74
|
variant: "tint",
|
|
71
75
|
tone: "warning",
|
|
72
|
-
class: "border-
|
|
76
|
+
class: "border-warning/40 bg-warning/15"
|
|
73
77
|
},
|
|
74
78
|
{
|
|
75
79
|
variant: "tint",
|
|
76
80
|
tone: "danger",
|
|
77
|
-
class: "border-
|
|
81
|
+
class: "border-danger/40 bg-danger/15"
|
|
78
82
|
}
|
|
79
83
|
],
|
|
80
84
|
defaultVariants: { variant: "default" }
|
package/dist/core/Badge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","names":[],"sources":["../../src/core/Badge.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"./utils.ts\";\n\nconst badgeVariants = cva(\n \"group/badge focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-danger aria-invalid:ring-danger/20 dark:aria-invalid:ring-danger/40 inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:ring-[3px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:pointer-events-none [&>svg]:size-3!\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary:\n \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive:\n \"bg-danger/10 text-danger-text focus-visible:ring-danger/20 dark:bg-danger/20 dark:focus-visible:ring-danger/40 [a]:hover:bg-danger/20\",\n outline:\n \"border-border text-foreground [a]:hover:bg-hover [a]:hover:text-muted-foreground\",\n /**\n * Status chip: the label and the icon stay body text, and the only\n * coloured parts are a near-transparent fill and its border.\n *\n * The caller supplies the hue, because a status palette belongs to\n * the app rather than to the design system:\n * `<Badge variant=\"tint\" className=\"border-blue-500/40 bg-blue-500/15\">`.\n *\n * Distinct from `destructive`, which tints the TEXT as well. That\n * reads as an alarm, which is right for an error and wrong for a\n * neutral fact like \"In progress\": at chip size, coloured text on a\n * coloured ground is also the pairing that fails contrast first.\n */\n tint: \"text-foreground border\",\n ghost: \"hover:bg-hover hover:text-muted-foreground dark:hover:bg-hover\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n /**\n * The hue of a `tint` badge: a near-transparent fill and a matching\n * border, with the label left as body text.\n *\n * Semantic names rather than colours, so a consumer states what a\n * status MEANS and the system decides how that looks. Lore maps its\n * quest statuses and priorities onto these; anything else mapping the\n * same meanings lands on the same chip without restating the hex.\n *\n * Applied only with `variant=\"tint\"`, through `compoundVariants`\n * below. The other variants paint their own background, and a tone\n * would fight them: before this was enforced, a `default` badge given a\n * tone lost its primary fill to the tone's wash, since tailwind-merge\n * keeps the last `bg-*`.\n */\n tone: {\n neutral: \"\",\n info: \"\",\n success: \"\",\n warning: \"\",\n danger: \"\",\n },\n },\n compoundVariants: [\n {\n variant: \"tint\",\n tone: \"neutral\",\n class: \"border-border bg-muted text-muted-foreground\",\n },\n {\n variant: \"tint\",\n tone: \"info\",\n class: \"border-blue-500/40 bg-blue-500/15\",\n },\n {\n variant: \"tint\",\n tone: \"success\",\n class: \"border-
|
|
1
|
+
{"version":3,"file":"Badge.js","names":[],"sources":["../../src/core/Badge.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"./utils.ts\";\n\nconst badgeVariants = cva(\n \"group/badge focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-danger aria-invalid:ring-danger/20 dark:aria-invalid:ring-danger/40 inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:ring-[3px] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:pointer-events-none [&>svg]:size-3!\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary:\n \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive:\n \"bg-danger/10 text-danger-text focus-visible:ring-danger/20 dark:bg-danger/20 dark:focus-visible:ring-danger/40 [a]:hover:bg-danger/20\",\n outline:\n \"border-border text-foreground [a]:hover:bg-hover [a]:hover:text-muted-foreground\",\n /**\n * Status chip: the label and the icon stay body text, and the only\n * coloured parts are a near-transparent fill and its border.\n *\n * The caller supplies the hue, because a status palette belongs to\n * the app rather than to the design system:\n * `<Badge variant=\"tint\" className=\"border-blue-500/40 bg-blue-500/15\">`.\n *\n * Distinct from `destructive`, which tints the TEXT as well. That\n * reads as an alarm, which is right for an error and wrong for a\n * neutral fact like \"In progress\": at chip size, coloured text on a\n * coloured ground is also the pairing that fails contrast first.\n */\n tint: \"text-foreground border\",\n ghost: \"hover:bg-hover hover:text-muted-foreground dark:hover:bg-hover\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n /**\n * The hue of a `tint` badge: a near-transparent fill and a matching\n * border, with the label left as body text.\n *\n * Semantic names rather than colours, so a consumer states what a\n * status MEANS and the system decides how that looks. Lore maps its\n * quest statuses and priorities onto these; anything else mapping the\n * same meanings lands on the same chip without restating the hex.\n *\n * Applied only with `variant=\"tint\"`, through `compoundVariants`\n * below. The other variants paint their own background, and a tone\n * would fight them: before this was enforced, a `default` badge given a\n * tone lost its primary fill to the tone's wash, since tailwind-merge\n * keeps the last `bg-*`.\n *\n * success, warning and danger paint from the signal tokens, not fixed\n * Tailwind hues, so colour-blind mode (`:root.cvd`) repaints them.\n * info stays blue: blue is already safe under every common deficiency.\n */\n tone: {\n neutral: \"\",\n info: \"\",\n success: \"\",\n warning: \"\",\n danger: \"\",\n },\n },\n compoundVariants: [\n {\n variant: \"tint\",\n tone: \"neutral\",\n class: \"border-border bg-muted text-muted-foreground\",\n },\n {\n variant: \"tint\",\n tone: \"info\",\n class: \"border-blue-500/40 bg-blue-500/15\",\n },\n {\n variant: \"tint\",\n tone: \"success\",\n class: \"border-success/40 bg-success/15\",\n },\n {\n variant: \"tint\",\n tone: \"warning\",\n class: \"border-warning/40 bg-warning/15\",\n },\n {\n variant: \"tint\",\n tone: \"danger\",\n class: \"border-danger/40 bg-danger/15\",\n },\n ],\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nexport type BadgeProps = useRender.ComponentProps<\"span\"> &\n VariantProps<typeof badgeVariants>;\n\nconst Badge = (props: BadgeProps) => {\n const { className, variant = \"default\", tone, render, ...rest } = props;\n return useRender({\n defaultTagName: \"span\",\n props: mergeProps<\"span\">(\n {\n className: cn(badgeVariants({ variant, tone }), className),\n },\n rest,\n ),\n render,\n state: {\n slot: \"badge\",\n variant,\n tone,\n },\n });\n};\n\n/**\n * The semantic hues a `tint` badge can wear.\n *\n * Exported because consumers map their own vocabulary onto it (Lore points\n * quest priorities, quest statuses and epic statuses at these names) and\n * every one of those maps needs a type for its record. Derived from the\n * variant rather than retyped, so adding a tone below cannot leave a\n * consumer's map silently incomplete.\n */\nexport type BadgeTone = NonNullable<VariantProps<typeof badgeVariants>[\"tone\"]>;\n\nexport { Badge, badgeVariants };\n"],"mappings":";;;;;AAMA,MAAM,gBAAgB,IACpB,+dACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,WACE;GACF,aACE;GACF,SACE;;;;;;;;;;;;;;GAcF,MAAM;GACN,OAAO;GACP,MAAM;EACR;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM;GACJ,SAAS;GACT,MAAM;GACN,SAAS;GACT,SAAS;GACT,QAAQ;EACV;CACF;CACA,kBAAkB;EAChB;GACE,SAAS;GACT,MAAM;GACN,OAAO;EACT;EACA;GACE,SAAS;GACT,MAAM;GACN,OAAO;EACT;EACA;GACE,SAAS;GACT,MAAM;GACN,OAAO;EACT;EACA;GACE,SAAS;GACT,MAAM;GACN,OAAO;EACT;EACA;GACE,SAAS;GACT,MAAM;GACN,OAAO;EACT;CACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CACF;AAKA,MAAM,SAAS,UAAsB;CACnC,MAAM,EAAE,WAAW,UAAU,WAAW,MAAM,QAAQ,GAAG,SAAS;CAClE,OAAO,UAAU;EACf,gBAAgB;EAChB,OAAO,WACL,EACE,WAAW,GAAG,cAAc;GAAE;GAAS;EAAK,CAAC,GAAG,SAAS,EAC3D,GACA,IACF;EACA;EACA,OAAO;GACL,MAAM;GACN;GACA;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
|
|
2
|
+
export type CollapsibleProps = CollapsiblePrimitive.Root.Props;
|
|
3
|
+
/**
|
|
4
|
+
* A disclosure: a trigger that opens and closes a panel, its height
|
|
5
|
+
* animated. Uncontrolled with `defaultOpen`, controlled with `open` and
|
|
6
|
+
* `onOpenChange`.
|
|
7
|
+
*
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <Collapsible>
|
|
10
|
+
* <CollapsibleTrigger chevron>Advanced options</CollapsibleTrigger>
|
|
11
|
+
* <CollapsiblePanel>...</CollapsiblePanel>
|
|
12
|
+
* </Collapsible>
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* The root and the panel carry `data-open` or `data-closed`, and the trigger
|
|
16
|
+
* `data-panel-open` while the panel is open, for the caller's own styles.
|
|
17
|
+
*/
|
|
18
|
+
declare const Collapsible: (props: CollapsibleProps) => import("react").JSX.Element;
|
|
19
|
+
export interface CollapsibleTriggerProps extends CollapsiblePrimitive.Trigger.Props {
|
|
20
|
+
/**
|
|
21
|
+
* Draw a chevron after the children, pointing down while closed and up
|
|
22
|
+
* while open. Defaults to `false`.
|
|
23
|
+
*/
|
|
24
|
+
chevron?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The button that opens and closes the panel. It carries `aria-expanded` and
|
|
28
|
+
* `aria-controls`. Its own styles are minimal (a row of its children, a focus
|
|
29
|
+
* ring): pass `render={<Button variant="ghost" />}` for a button look.
|
|
30
|
+
*/
|
|
31
|
+
declare const CollapsibleTrigger: (props: CollapsibleTriggerProps) => import("react").JSX.Element;
|
|
32
|
+
export type CollapsiblePanelProps = CollapsiblePrimitive.Panel.Props;
|
|
33
|
+
/**
|
|
34
|
+
* The panel the trigger opens. Its height runs from 0 to its content's
|
|
35
|
+
* through `--collapsible-panel-height`, which Base UI measures, and the
|
|
36
|
+
* transition is dropped under `prefers-reduced-motion`.
|
|
37
|
+
*
|
|
38
|
+
* Closed, it is not rendered, so nothing in it can take focus; on the server
|
|
39
|
+
* it renders open or not at all, per `defaultOpen`, and opens at its natural
|
|
40
|
+
* height, with no animation on the first paint. `keepMounted` keeps it in the
|
|
41
|
+
* DOM while closed (hidden), and `hiddenUntilFound` lets the browser's page
|
|
42
|
+
* search find and open it.
|
|
43
|
+
*
|
|
44
|
+
* It clips its content while it moves (`overflow-hidden`): give the content
|
|
45
|
+
* its own padding rather than the panel, so the height runs to the padding's
|
|
46
|
+
* edge too.
|
|
47
|
+
*/
|
|
48
|
+
declare const CollapsiblePanel: (props: CollapsiblePanelProps) => import("react").JSX.Element;
|
|
49
|
+
export { Collapsible, CollapsiblePanel, CollapsibleTrigger };
|
|
50
|
+
//# sourceMappingURL=Collapsible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collapsible.d.ts","sourceRoot":"","sources":["../../src/core/Collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAKjF,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC;AAE/D;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,WAAW,UAAW,gBAAgB,gCAE3C,CAAC;AAEF,MAAM,WAAW,uBACf,SAAQ,oBAAoB,CAAC,OAAO,CAAC,KAAK;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,QAAA,MAAM,kBAAkB,UAAW,uBAAuB,gCAqBzD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,CAAC,KAAK,CAAC,KAAK,CAAC;AAErE;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,gBAAgB,UAAW,qBAAqB,gCAYrD,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { cn } from "./utils.js";
|
|
2
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
|
|
5
|
+
// src/core/Collapsible.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A disclosure: a trigger that opens and closes a panel, its height
|
|
8
|
+
* animated. Uncontrolled with `defaultOpen`, controlled with `open` and
|
|
9
|
+
* `onOpenChange`.
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <Collapsible>
|
|
13
|
+
* <CollapsibleTrigger chevron>Advanced options</CollapsibleTrigger>
|
|
14
|
+
* <CollapsiblePanel>...</CollapsiblePanel>
|
|
15
|
+
* </Collapsible>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* The root and the panel carry `data-open` or `data-closed`, and the trigger
|
|
19
|
+
* `data-panel-open` while the panel is open, for the caller's own styles.
|
|
20
|
+
*/
|
|
21
|
+
const Collapsible = (props) => {
|
|
22
|
+
return /* @__PURE__ */ jsx(Collapsible$1.Root, {
|
|
23
|
+
"data-slot": "collapsible",
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The button that opens and closes the panel. It carries `aria-expanded` and
|
|
29
|
+
* `aria-controls`. Its own styles are minimal (a row of its children, a focus
|
|
30
|
+
* ring): pass `render={<Button variant="ghost" />}` for a button look.
|
|
31
|
+
*/
|
|
32
|
+
const CollapsibleTrigger = (props) => {
|
|
33
|
+
const { className, chevron = false, children, ...rest } = props;
|
|
34
|
+
return /* @__PURE__ */ jsxs(Collapsible$1.Trigger, {
|
|
35
|
+
"data-slot": "collapsible-trigger",
|
|
36
|
+
className: cn("group/collapsible-trigger focus-visible:ring-ring/50 inline-flex items-center gap-1.5 rounded-md text-sm font-medium outline-none focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-50", className),
|
|
37
|
+
...rest,
|
|
38
|
+
children: [children, chevron && /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
39
|
+
"aria-hidden": true,
|
|
40
|
+
"data-slot": "collapsible-chevron",
|
|
41
|
+
className: "text-muted-foreground size-4 shrink-0 transition-transform duration-200 group-data-[panel-open]/collapsible-trigger:rotate-180 motion-reduce:transition-none"
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The panel the trigger opens. Its height runs from 0 to its content's
|
|
47
|
+
* through `--collapsible-panel-height`, which Base UI measures, and the
|
|
48
|
+
* transition is dropped under `prefers-reduced-motion`.
|
|
49
|
+
*
|
|
50
|
+
* Closed, it is not rendered, so nothing in it can take focus; on the server
|
|
51
|
+
* it renders open or not at all, per `defaultOpen`, and opens at its natural
|
|
52
|
+
* height, with no animation on the first paint. `keepMounted` keeps it in the
|
|
53
|
+
* DOM while closed (hidden), and `hiddenUntilFound` lets the browser's page
|
|
54
|
+
* search find and open it.
|
|
55
|
+
*
|
|
56
|
+
* It clips its content while it moves (`overflow-hidden`): give the content
|
|
57
|
+
* its own padding rather than the panel, so the height runs to the padding's
|
|
58
|
+
* edge too.
|
|
59
|
+
*/
|
|
60
|
+
const CollapsiblePanel = (props) => {
|
|
61
|
+
const { className, ...rest } = props;
|
|
62
|
+
return /* @__PURE__ */ jsx(Collapsible$1.Panel, {
|
|
63
|
+
"data-slot": "collapsible-panel",
|
|
64
|
+
className: cn("h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 ease-out data-ending-style:h-0 data-starting-style:h-0 motion-reduce:transition-none", className),
|
|
65
|
+
...rest
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
export { Collapsible, CollapsiblePanel, CollapsibleTrigger };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=Collapsible.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Collapsible.js","names":["CollapsiblePrimitive"],"sources":["../../src/core/Collapsible.tsx"],"sourcesContent":["import { Collapsible as CollapsiblePrimitive } from \"@base-ui/react/collapsible\";\nimport { ChevronDownIcon } from \"lucide-react\";\n\nimport { cn } from \"./utils.ts\";\n\nexport type CollapsibleProps = CollapsiblePrimitive.Root.Props;\n\n/**\n * A disclosure: a trigger that opens and closes a panel, its height\n * animated. Uncontrolled with `defaultOpen`, controlled with `open` and\n * `onOpenChange`.\n *\n * ```tsx\n * <Collapsible>\n * <CollapsibleTrigger chevron>Advanced options</CollapsibleTrigger>\n * <CollapsiblePanel>...</CollapsiblePanel>\n * </Collapsible>\n * ```\n *\n * The root and the panel carry `data-open` or `data-closed`, and the trigger\n * `data-panel-open` while the panel is open, for the caller's own styles.\n */\nconst Collapsible = (props: CollapsibleProps) => {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n};\n\nexport interface CollapsibleTriggerProps\n extends CollapsiblePrimitive.Trigger.Props {\n /**\n * Draw a chevron after the children, pointing down while closed and up\n * while open. Defaults to `false`.\n */\n chevron?: boolean;\n}\n\n/**\n * The button that opens and closes the panel. It carries `aria-expanded` and\n * `aria-controls`. Its own styles are minimal (a row of its children, a focus\n * ring): pass `render={<Button variant=\"ghost\" />}` for a button look.\n */\nconst CollapsibleTrigger = (props: CollapsibleTriggerProps) => {\n const { className, chevron = false, children, ...rest } = props;\n return (\n <CollapsiblePrimitive.Trigger\n data-slot=\"collapsible-trigger\"\n className={cn(\n \"group/collapsible-trigger focus-visible:ring-ring/50 inline-flex items-center gap-1.5 rounded-md text-sm font-medium outline-none focus-visible:ring-3 disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n {...rest}\n >\n {children}\n {chevron && (\n <ChevronDownIcon\n aria-hidden\n data-slot=\"collapsible-chevron\"\n className=\"text-muted-foreground size-4 shrink-0 transition-transform duration-200 group-data-[panel-open]/collapsible-trigger:rotate-180 motion-reduce:transition-none\"\n />\n )}\n </CollapsiblePrimitive.Trigger>\n );\n};\n\nexport type CollapsiblePanelProps = CollapsiblePrimitive.Panel.Props;\n\n/**\n * The panel the trigger opens. Its height runs from 0 to its content's\n * through `--collapsible-panel-height`, which Base UI measures, and the\n * transition is dropped under `prefers-reduced-motion`.\n *\n * Closed, it is not rendered, so nothing in it can take focus; on the server\n * it renders open or not at all, per `defaultOpen`, and opens at its natural\n * height, with no animation on the first paint. `keepMounted` keeps it in the\n * DOM while closed (hidden), and `hiddenUntilFound` lets the browser's page\n * search find and open it.\n *\n * It clips its content while it moves (`overflow-hidden`): give the content\n * its own padding rather than the panel, so the height runs to the padding's\n * edge too.\n */\nconst CollapsiblePanel = (props: CollapsiblePanelProps) => {\n const { className, ...rest } = props;\n return (\n <CollapsiblePrimitive.Panel\n data-slot=\"collapsible-panel\"\n className={cn(\n \"h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-200 ease-out data-ending-style:h-0 data-starting-style:h-0 motion-reduce:transition-none\",\n className,\n )}\n {...rest}\n />\n );\n};\n\nexport { Collapsible, CollapsiblePanel, CollapsibleTrigger };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,eAAe,UAA4B;CAC/C,OAAO,oBAACA,cAAqB,MAAtB;EAA2B,aAAU;EAAc,GAAI;CAAQ,CAAA;AACxE;;;;;;AAgBA,MAAM,sBAAsB,UAAmC;CAC7D,MAAM,EAAE,WAAW,UAAU,OAAO,UAAU,GAAG,SAAS;CAC1D,OACE,qBAACA,cAAqB,SAAtB;EACE,aAAU;EACV,WAAW,GACT,2MACA,SACF;EACA,GAAI;EANN,UAAA,CAQG,UACA,WACC,oBAAC,iBAAD;GACE,eAAA;GACA,aAAU;GACV,WAAU;EACX,CAAA,CAEyB;;AAElC;;;;;;;;;;;;;;;;AAmBA,MAAM,oBAAoB,UAAiC;CACzD,MAAM,EAAE,WAAW,GAAG,SAAS;CAC/B,OACE,oBAACA,cAAqB,OAAtB;EACE,aAAU;EACV,WAAW,GACT,wKACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
package/dist/core/Combobox.d.ts
CHANGED
|
@@ -3,7 +3,13 @@ import * as React from "react";
|
|
|
3
3
|
declare const Combobox: typeof ComboboxPrimitive.Root;
|
|
4
4
|
export type ComboboxValueProps = ComboboxPrimitive.Value.Props;
|
|
5
5
|
declare const ComboboxValue: (props: ComboboxValueProps) => React.JSX.Element;
|
|
6
|
-
export type ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props
|
|
6
|
+
export type ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props & {
|
|
7
|
+
/**
|
|
8
|
+
* Draw the trailing caret. Defaults to true; off for a trigger that is not
|
|
9
|
+
* a field, such as a table header's funnel button.
|
|
10
|
+
*/
|
|
11
|
+
chevron?: boolean;
|
|
12
|
+
};
|
|
7
13
|
declare const ComboboxTrigger: (props: ComboboxTriggerProps) => React.JSX.Element;
|
|
8
14
|
export type ComboboxClearProps = ComboboxPrimitive.Clear.Props;
|
|
9
15
|
export type ComboboxInputProps = ComboboxPrimitive.Input.Props & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../src/core/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,QAAA,MAAM,QAAQ,+BAAyB,CAAC;AAExC,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC;AAE/D,QAAA,MAAM,aAAa,UAAW,kBAAkB,sBAE/C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../src/core/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,QAAA,MAAM,QAAQ,+BAAyB,CAAC;AAExC,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC;AAE/D,QAAA,MAAM,aAAa,UAAW,kBAAkB,sBAE/C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,OAAO,CAAC,KAAK,GAAG;IACnE;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,QAAA,MAAM,eAAe,UAAW,oBAAoB,sBAcnD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC;AAgB/D,MAAM,MAAM,k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CAAC,SAAS,CAAC,KAAK,CAAC;AAEvE,QAAA,MAAM,iBAAiB,UAAW,sBAAsB,sBASvD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,qBAAqB,CAC1D,OAAO,iBAAiB,CAAC,KAAK,CAC/B,GACC,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC;AAEhC,QAAA,MAAM,aAAa,UAAW,kBAAkB,sBAY/C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,IAAI,CAAC,KAAK,GAAG;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,QAAA,MAAM,YAAY,UAAW,iBAAiB,sBAuB7C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC;AAEpE,QAAA,MAAM,kBAAkB,UAAW,uBAAuB,sBASzD,CAAC;AAEF,iBAAS,iBAAiB,2CAEzB;AAED,OAAO,EACL,QAAQ,EACR,aAAa,EACb,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,iBAAiB,GAClB,CAAC"}
|
package/dist/core/Combobox.js
CHANGED
|
@@ -14,12 +14,12 @@ const ComboboxValue = (props) => {
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
const ComboboxTrigger = (props) => {
|
|
17
|
-
const { className, children, ...rest } = props;
|
|
17
|
+
const { className, children, chevron = true, ...rest } = props;
|
|
18
18
|
return /* @__PURE__ */ jsxs(Combobox$1.Trigger, {
|
|
19
19
|
"data-slot": "combobox-trigger",
|
|
20
20
|
className: cn("[&_svg:not([class*='size-'])]:size-4", className),
|
|
21
21
|
...rest,
|
|
22
|
-
children: [children, /* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4" })]
|
|
22
|
+
children: [children, chevron && /* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4" })]
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
const ComboboxClear = (props) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.js","names":["ComboboxPrimitive"],"sources":["../../src/core/Combobox.tsx"],"sourcesContent":["import { Combobox as ComboboxPrimitive } from \"@base-ui/react\";\nimport { CheckIcon, ChevronDownIcon, XIcon } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { Button } from \"./Button.tsx\";\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"./InputGroup.tsx\";\nimport { cn } from \"./utils.ts\";\n\nconst Combobox = ComboboxPrimitive.Root;\n\nexport type ComboboxValueProps = ComboboxPrimitive.Value.Props;\n\nconst ComboboxValue = (props: ComboboxValueProps) => {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />;\n};\n\nexport type ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props;\n\nconst ComboboxTrigger = (props: ComboboxTriggerProps) => {\n const { className, children, ...rest } = props;\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className={cn(\"[&_svg:not([class*='size-'])]:size-4\", className)}\n {...rest}\n >\n {children}\n <ChevronDownIcon className=\"text-muted-foreground pointer-events-none size-4\" />\n </ComboboxPrimitive.Trigger>\n );\n};\n\nexport type ComboboxClearProps = ComboboxPrimitive.Clear.Props;\n\nconst ComboboxClear = (props: ComboboxClearProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={<InputGroupButton variant=\"minimal\" size=\"icon-xs\" />}\n className={cn(className)}\n {...rest}\n >\n <XIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n );\n};\n\nexport type ComboboxInputProps = ComboboxPrimitive.Input.Props & {\n showTrigger?: boolean;\n showClear?: boolean;\n};\n\nconst ComboboxInput = (props: ComboboxInputProps) => {\n const {\n className,\n children,\n disabled = false,\n showTrigger = true,\n showClear = false,\n ...rest\n } = props;\n return (\n <InputGroup className={cn(\"w-auto\", className)}>\n <ComboboxPrimitive.Input\n render={<InputGroupInput disabled={disabled} />}\n {...rest}\n />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"minimal\"\n render={<ComboboxTrigger />}\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n />\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n );\n};\n\nexport type ComboboxContentProps = ComboboxPrimitive.Popup.Props &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n \"side\" | \"align\" | \"sideOffset\" | \"alignOffset\" | \"anchor\"\n >;\n\nconst ComboboxContent = (props: ComboboxContentProps) => {\n const {\n className,\n side = \"bottom\",\n sideOffset = 6,\n align = \"start\",\n alignOffset = 0,\n anchor,\n ...rest\n } = props;\n return (\n <ComboboxPrimitive.Portal>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"isolate z-50\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={cn(\n \"group/combobox-content bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:border-border/30 *:data-[slot=input-group]:bg-input/30 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg shadow-md ring-1 duration-100 data-[chips=true]:min-w-(--anchor-width) *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none\",\n className,\n )}\n {...rest}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n );\n};\n\nexport type ComboboxListProps = ComboboxPrimitive.List.Props;\n\nconst ComboboxList = (props: ComboboxListProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n \"no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0\",\n className,\n )}\n {...rest}\n />\n );\n};\n\nexport type ComboboxItemProps = ComboboxPrimitive.Item.Props;\n\nconst ComboboxItem = (props: ComboboxItemProps) => {\n const { className, children, ...rest } = props;\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={cn(\n \"data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...rest}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />\n }\n >\n <CheckIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n );\n};\n\nexport type ComboboxGroupProps = ComboboxPrimitive.Group.Props;\n\nconst ComboboxGroup = (props: ComboboxGroupProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.Group\n data-slot=\"combobox-group\"\n className={cn(className)}\n {...rest}\n />\n );\n};\n\nexport type ComboboxLabelProps = ComboboxPrimitive.GroupLabel.Props;\n\nconst ComboboxLabel = (props: ComboboxLabelProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={cn(\"text-muted-foreground px-2 py-1.5 text-xs\", className)}\n {...rest}\n />\n );\n};\n\nexport type ComboboxCollectionProps = ComboboxPrimitive.Collection.Props;\n\nconst ComboboxCollection = (props: ComboboxCollectionProps) => {\n return (\n <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n );\n};\n\nexport type ComboboxEmptyProps = ComboboxPrimitive.Empty.Props;\n\nconst ComboboxEmpty = (props: ComboboxEmptyProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n \"text-muted-foreground hidden w-full justify-center py-2 text-center text-sm group-data-empty/combobox-content:flex\",\n className,\n )}\n {...rest}\n />\n );\n};\n\nexport type ComboboxSeparatorProps = ComboboxPrimitive.Separator.Props;\n\nconst ComboboxSeparator = (props: ComboboxSeparatorProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...rest}\n />\n );\n};\n\nexport type ComboboxChipsProps = React.ComponentPropsWithRef<\n typeof ComboboxPrimitive.Chips\n> &\n ComboboxPrimitive.Chips.Props;\n\nconst ComboboxChips = (props: ComboboxChipsProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={cn(\n \"border-border focus-within:border-ring focus-within:ring-ring/50 has-aria-invalid:border-danger has-aria-invalid:ring-danger/20 dark:bg-input/30 dark:has-aria-invalid:border-danger/50 dark:has-aria-invalid:ring-danger/40 flex min-h-8 flex-wrap items-center gap-1 rounded-lg border bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:ring-3 has-aria-invalid:ring-3 has-data-[slot=combobox-chip]:px-1\",\n className,\n )}\n {...rest}\n />\n );\n};\n\nexport type ComboboxChipProps = ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean;\n};\n\nconst ComboboxChip = (props: ComboboxChipProps) => {\n const { className, children, showRemove = true, ...rest } = props;\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={cn(\n \"bg-muted text-foreground flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm px-1.5 text-xs font-medium whitespace-nowrap has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0\",\n className,\n )}\n {...rest}\n >\n {children}\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"minimal\" size=\"icon-xs\" />}\n className=\"-ml-1 opacity-50 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n >\n <XIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n );\n};\n\nexport type ComboboxChipsInputProps = ComboboxPrimitive.Input.Props;\n\nconst ComboboxChipsInput = (props: ComboboxChipsInputProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.Input\n data-slot=\"combobox-chip-input\"\n className={cn(\"min-w-16 flex-1 outline-none\", className)}\n {...rest}\n />\n );\n};\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null);\n}\n\nexport {\n Combobox,\n ComboboxInput,\n ComboboxContent,\n ComboboxList,\n ComboboxItem,\n ComboboxGroup,\n ComboboxLabel,\n ComboboxCollection,\n ComboboxEmpty,\n ComboboxSeparator,\n ComboboxChips,\n ComboboxChip,\n ComboboxChipsInput,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor,\n};\n"],"mappings":";;;;;;;;AAaA,M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MAAM,EAAE,WAAW,GAAG,SAAS;CAC/B,OACE,oBAACA,WAAkB,OAAnB;EACE,aAAU;EACV,WAAW,GACT,sHACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAIA,MAAM,qBAAqB,UAAkC;CAC3D,MAAM,EAAE,WAAW,GAAG,SAAS;CAC/B,OACE,oBAACA,WAAkB,WAAnB;EACE,aAAU;EACV,WAAW,GAAG,6BAA6B,SAAS;EACpD,GAAI;CACL,CAAA;AAEL;AAOA,MAAM,iBAAiB,UAA8B;CACnD,MAAM,EAAE,WAAW,GAAG,SAAS;CAC/B,OACE,oBAACA,WAAkB,OAAnB;EACE,aAAU;EACV,WAAW,GACT,gbACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAMA,MAAM,gBAAgB,UAA6B;CACjD,MAAM,EAAE,WAAW,UAAU,aAAa,MAAM,GAAG,SAAS;CAC5D,OACE,qBAACA,WAAkB,MAAnB;EACE,aAAU;EACV,WAAW,GACT,8RACA,SACF;EACA,GAAI;EANN,UAAA,CAQG,UACA,cACC,oBAACA,WAAkB,YAAnB;GACE,QAAQ,oBAAC,QAAD;IAAQ,SAAQ;IAAU,MAAK;GAAW,CAAA;GAClD,WAAU;GACV,aAAU;GAEV,UAAA,oBAAC,OAAD,EAAO,WAAU,sBAAuB,CAAA;EACZ,CAAA,CAEV;;AAE5B;AAIA,MAAM,sBAAsB,UAAmC;CAC7D,MAAM,EAAE,WAAW,GAAG,SAAS;CAC/B,OACE,oBAACA,WAAkB,OAAnB;EACE,aAAU;EACV,WAAW,GAAG,gCAAgC,SAAS;EACvD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,oBAAoB;CAC3B,OAAO,MAAM,OAA8B,IAAI;AACjD"}
|
|
1
|
+
{"version":3,"file":"Combobox.js","names":["ComboboxPrimitive"],"sources":["../../src/core/Combobox.tsx"],"sourcesContent":["import { Combobox as ComboboxPrimitive } from \"@base-ui/react\";\nimport { CheckIcon, ChevronDownIcon, XIcon } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { Button } from \"./Button.tsx\";\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"./InputGroup.tsx\";\nimport { cn } from \"./utils.ts\";\n\nconst Combobox = ComboboxPrimitive.Root;\n\nexport type ComboboxValueProps = ComboboxPrimitive.Value.Props;\n\nconst ComboboxValue = (props: ComboboxValueProps) => {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />;\n};\n\nexport type ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props & {\n /**\n * Draw the trailing caret. Defaults to true; off for a trigger that is not\n * a field, such as a table header's funnel button.\n */\n chevron?: boolean;\n};\n\nconst ComboboxTrigger = (props: ComboboxTriggerProps) => {\n const { className, children, chevron = true, ...rest } = props;\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n className={cn(\"[&_svg:not([class*='size-'])]:size-4\", className)}\n {...rest}\n >\n {children}\n {chevron && (\n <ChevronDownIcon className=\"text-muted-foreground pointer-events-none size-4\" />\n )}\n </ComboboxPrimitive.Trigger>\n );\n};\n\nexport type ComboboxClearProps = ComboboxPrimitive.Clear.Props;\n\nconst ComboboxClear = (props: ComboboxClearProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n render={<InputGroupButton variant=\"minimal\" size=\"icon-xs\" />}\n className={cn(className)}\n {...rest}\n >\n <XIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n );\n};\n\nexport type ComboboxInputProps = ComboboxPrimitive.Input.Props & {\n showTrigger?: boolean;\n showClear?: boolean;\n};\n\nconst ComboboxInput = (props: ComboboxInputProps) => {\n const {\n className,\n children,\n disabled = false,\n showTrigger = true,\n showClear = false,\n ...rest\n } = props;\n return (\n <InputGroup className={cn(\"w-auto\", className)}>\n <ComboboxPrimitive.Input\n render={<InputGroupInput disabled={disabled} />}\n {...rest}\n />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"minimal\"\n render={<ComboboxTrigger />}\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n />\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n );\n};\n\nexport type ComboboxContentProps = ComboboxPrimitive.Popup.Props &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n \"side\" | \"align\" | \"sideOffset\" | \"alignOffset\" | \"anchor\"\n >;\n\nconst ComboboxContent = (props: ComboboxContentProps) => {\n const {\n className,\n side = \"bottom\",\n sideOffset = 6,\n align = \"start\",\n alignOffset = 0,\n anchor,\n ...rest\n } = props;\n return (\n <ComboboxPrimitive.Portal>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"isolate z-50\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={cn(\n \"group/combobox-content bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:border-border/30 *:data-[slot=input-group]:bg-input/30 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg shadow-md ring-1 duration-100 data-[chips=true]:min-w-(--anchor-width) *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none\",\n className,\n )}\n {...rest}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n );\n};\n\nexport type ComboboxListProps = ComboboxPrimitive.List.Props;\n\nconst ComboboxList = (props: ComboboxListProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n \"no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0\",\n className,\n )}\n {...rest}\n />\n );\n};\n\nexport type ComboboxItemProps = ComboboxPrimitive.Item.Props;\n\nconst ComboboxItem = (props: ComboboxItemProps) => {\n const { className, children, ...rest } = props;\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={cn(\n \"data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...rest}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />\n }\n >\n <CheckIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n );\n};\n\nexport type ComboboxGroupProps = ComboboxPrimitive.Group.Props;\n\nconst ComboboxGroup = (props: ComboboxGroupProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.Group\n data-slot=\"combobox-group\"\n className={cn(className)}\n {...rest}\n />\n );\n};\n\nexport type ComboboxLabelProps = ComboboxPrimitive.GroupLabel.Props;\n\nconst ComboboxLabel = (props: ComboboxLabelProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={cn(\"text-muted-foreground px-2 py-1.5 text-xs\", className)}\n {...rest}\n />\n );\n};\n\nexport type ComboboxCollectionProps = ComboboxPrimitive.Collection.Props;\n\nconst ComboboxCollection = (props: ComboboxCollectionProps) => {\n return (\n <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n );\n};\n\nexport type ComboboxEmptyProps = ComboboxPrimitive.Empty.Props;\n\nconst ComboboxEmpty = (props: ComboboxEmptyProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n \"text-muted-foreground hidden w-full justify-center py-2 text-center text-sm group-data-empty/combobox-content:flex\",\n className,\n )}\n {...rest}\n />\n );\n};\n\nexport type ComboboxSeparatorProps = ComboboxPrimitive.Separator.Props;\n\nconst ComboboxSeparator = (props: ComboboxSeparatorProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...rest}\n />\n );\n};\n\nexport type ComboboxChipsProps = React.ComponentPropsWithRef<\n typeof ComboboxPrimitive.Chips\n> &\n ComboboxPrimitive.Chips.Props;\n\nconst ComboboxChips = (props: ComboboxChipsProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={cn(\n \"border-border focus-within:border-ring focus-within:ring-ring/50 has-aria-invalid:border-danger has-aria-invalid:ring-danger/20 dark:bg-input/30 dark:has-aria-invalid:border-danger/50 dark:has-aria-invalid:ring-danger/40 flex min-h-8 flex-wrap items-center gap-1 rounded-lg border bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:ring-3 has-aria-invalid:ring-3 has-data-[slot=combobox-chip]:px-1\",\n className,\n )}\n {...rest}\n />\n );\n};\n\nexport type ComboboxChipProps = ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean;\n};\n\nconst ComboboxChip = (props: ComboboxChipProps) => {\n const { className, children, showRemove = true, ...rest } = props;\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={cn(\n \"bg-muted text-foreground flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm px-1.5 text-xs font-medium whitespace-nowrap has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0\",\n className,\n )}\n {...rest}\n >\n {children}\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"minimal\" size=\"icon-xs\" />}\n className=\"-ml-1 opacity-50 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n >\n <XIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n );\n};\n\nexport type ComboboxChipsInputProps = ComboboxPrimitive.Input.Props;\n\nconst ComboboxChipsInput = (props: ComboboxChipsInputProps) => {\n const { className, ...rest } = props;\n return (\n <ComboboxPrimitive.Input\n data-slot=\"combobox-chip-input\"\n className={cn(\"min-w-16 flex-1 outline-none\", className)}\n {...rest}\n />\n );\n};\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null);\n}\n\nexport {\n Combobox,\n ComboboxInput,\n ComboboxContent,\n ComboboxList,\n ComboboxItem,\n ComboboxGroup,\n ComboboxLabel,\n ComboboxCollection,\n ComboboxEmpty,\n ComboboxSeparator,\n ComboboxChips,\n ComboboxChip,\n ComboboxChipsInput,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor,\n};\n"],"mappings":";;;;;;;;AAaA,MAAM,WAAWA,WAAkB;AAInC,MAAM,iBAAiB,UAA8B;CACnD,OAAO,oBAACA,WAAkB,OAAnB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAUA,MAAM,mBAAmB,UAAgC;CACvD,MAAM,EAAE,WAAW,UAAU,UAAU,MAAM,GAAG,SAAS;CACzD,OACE,qBAACA,WAAkB,SAAnB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AnB;EACE,aAAU;EACV,WAAW,GAAG,6BAA6B,SAAS;EACpD,GAAI;CACL,CAAA;AAEL;AAOA,MAAM,iBAAiB,UAA8B;CACnD,MAAM,EAAE,WAAW,GAAG,SAAS;CAC/B,OACE,oBAACA,WAAkB,OAAnB;EACE,aAAU;EACV,WAAW,GACT,gbACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAMA,MAAM,gBAAgB,UAA6B;CACjD,MAAM,EAAE,WAAW,UAAU,aAAa,MAAM,GAAG,SAAS;CAC5D,OACE,qBAACA,WAAkB,MAAnB;EACE,aAAU;EACV,WAAW,GACT,8RACA,SACF;EACA,GAAI;EANN,UAAA,CAQG,UACA,cACC,oBAACA,WAAkB,YAAnB;GACE,QAAQ,oBAAC,QAAD;IAAQ,SAAQ;IAAU,MAAK;GAAW,CAAA;GAClD,WAAU;GACV,aAAU;GAEV,UAAA,oBAAC,OAAD,EAAO,WAAU,sBAAuB,CAAA;EACZ,CAAA,CAEV;;AAE5B;AAIA,MAAM,sBAAsB,UAAmC;CAC7D,MAAM,EAAE,WAAW,GAAG,SAAS;CAC/B,OACE,oBAACA,WAAkB,OAAnB;EACE,aAAU;EACV,WAAW,GAAG,gCAAgC,SAAS;EACvD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,oBAAoB;CAC3B,OAAO,MAAM,OAA8B,IAAI;AACjD"}
|
package/dist/core/PaneRail.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
1
2
|
export interface PaneRailProps {
|
|
2
3
|
/**
|
|
3
4
|
* The edge of the layout the collapsed pane sits on. It picks the icon and
|
|
@@ -9,22 +10,38 @@ export interface PaneRailProps {
|
|
|
9
10
|
*/
|
|
10
11
|
label: string;
|
|
11
12
|
onExpand: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* The pane's own icon, at the top of the strip. Given one, the rail names
|
|
15
|
+
* WHAT it reopens, and the open-panel arrow moves to the strip's foot so
|
|
16
|
+
* the strip still says it opens something. Without one the arrow is the
|
|
17
|
+
* only mark, at the top.
|
|
18
|
+
*/
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Shown under the top icon: a count badge, say. Not separately
|
|
22
|
+
* actionable, since the whole strip is the button.
|
|
23
|
+
*/
|
|
24
|
+
children?: ReactNode;
|
|
12
25
|
className?: string;
|
|
26
|
+
"data-testid"?: string;
|
|
13
27
|
}
|
|
14
28
|
/**
|
|
15
|
-
* What a collapsible pane leaves behind once it is closed: a 36px strip
|
|
16
|
-
* the
|
|
29
|
+
* What a collapsible pane leaves behind once it is closed: a 36px strip that
|
|
30
|
+
* is, all of it, the button that brings the pane back.
|
|
17
31
|
*
|
|
18
32
|
* A pane closed with a click has to say how to reopen it. Collapsing to
|
|
19
33
|
* nothing strands the reader: the only routes back left are a keyboard
|
|
20
34
|
* shortcut and a menu that does not advertise itself, for a pane they just
|
|
21
35
|
* closed with a click.
|
|
22
36
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
37
|
+
* The whole strip is the hit area, hover included, rather than a small
|
|
38
|
+
* button at its top: the strip has no other use, and a 28px target inside a
|
|
39
|
+
* full-height column reads as broken when a click below it does nothing.
|
|
40
|
+
*
|
|
41
|
+
* It moved from Lore into the kit with #Q2265 and became one full-height
|
|
42
|
+
* button with #Q3206, so the admin Parameters History panel, Lore's folio
|
|
43
|
+
* tree and inspector, and Lore's Quest Log (`icon` plus a count as
|
|
44
|
+
* `children`) share one strip and cannot drift apart.
|
|
28
45
|
*
|
|
29
46
|
* ⚠️ Render it only where the pane would otherwise be a COLUMN. Where a
|
|
30
47
|
* layout stacks its panes or turns one into an overlay, a strip frees no
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaneRail.d.ts","sourceRoot":"","sources":["../../src/core/PaneRail.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PaneRail.d.ts","sourceRoot":"","sources":["../../src/core/PaneRail.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,QAAQ,UAAW,aAAa,gCAqB5C,CAAC"}
|
package/dist/core/PaneRail.js
CHANGED
|
@@ -1,38 +1,43 @@
|
|
|
1
1
|
import { cn } from "./utils.js";
|
|
2
2
|
import { PanelLeftOpen, PanelRightOpen } from "lucide-react";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
// src/core/PaneRail.tsx
|
|
5
5
|
/**
|
|
6
|
-
* What a collapsible pane leaves behind once it is closed: a 36px strip
|
|
7
|
-
* the
|
|
6
|
+
* What a collapsible pane leaves behind once it is closed: a 36px strip that
|
|
7
|
+
* is, all of it, the button that brings the pane back.
|
|
8
8
|
*
|
|
9
9
|
* A pane closed with a click has to say how to reopen it. Collapsing to
|
|
10
10
|
* nothing strands the reader: the only routes back left are a keyboard
|
|
11
11
|
* shortcut and a menu that does not advertise itself, for a pane they just
|
|
12
12
|
* closed with a click.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* The whole strip is the hit area, hover included, rather than a small
|
|
15
|
+
* button at its top: the strip has no other use, and a 28px target inside a
|
|
16
|
+
* full-height column reads as broken when a click below it does nothing.
|
|
17
|
+
*
|
|
18
|
+
* It moved from Lore into the kit with #Q2265 and became one full-height
|
|
19
|
+
* button with #Q3206, so the admin Parameters History panel, Lore's folio
|
|
20
|
+
* tree and inspector, and Lore's Quest Log (`icon` plus a count as
|
|
21
|
+
* `children`) share one strip and cannot drift apart.
|
|
19
22
|
*
|
|
20
23
|
* ⚠️ Render it only where the pane would otherwise be a COLUMN. Where a
|
|
21
24
|
* layout stacks its panes or turns one into an overlay, a strip frees no
|
|
22
25
|
* width and only changes the default layout.
|
|
23
26
|
*/
|
|
24
27
|
const PaneRail = (props) => {
|
|
25
|
-
const
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
const Arrow = props.side === "left" ? PanelLeftOpen : PanelRightOpen;
|
|
29
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
30
|
+
type: "button",
|
|
31
|
+
onClick: props.onExpand,
|
|
32
|
+
"aria-label": props.label,
|
|
33
|
+
title: props.label,
|
|
34
|
+
"data-testid": props["data-testid"],
|
|
35
|
+
className: cn("border-border text-muted-foreground hover:text-foreground hover:bg-hover focus-visible:ring-ring/50 flex w-9 flex-none cursor-pointer flex-col items-center gap-2 pt-3 transition-colors outline-none focus-visible:ring-3 focus-visible:ring-inset", props.side === "left" ? "border-r" : "border-l", props.className),
|
|
36
|
+
children: [
|
|
37
|
+
props.icon ?? /* @__PURE__ */ jsx(Arrow, { className: "size-4 shrink-0" }),
|
|
38
|
+
props.children,
|
|
39
|
+
props.icon && /* @__PURE__ */ jsx(Arrow, { className: "mt-auto mb-3 size-3.5 shrink-0" })
|
|
40
|
+
]
|
|
36
41
|
});
|
|
37
42
|
};
|
|
38
43
|
export { PaneRail };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaneRail.js","names":[],"sources":["../../src/core/PaneRail.tsx"],"sourcesContent":["import { PanelLeftOpen, PanelRightOpen } from \"lucide-react\";\n\nimport { cn } from \"./utils.ts\";\n\nexport interface PaneRailProps {\n /**\n * The edge of the layout the collapsed pane sits on. It picks the icon and\n * puts the border on the side that faces the content the pane was beside.\n */\n side: \"left\" | \"right\";\n /**\n * The expand button's accessible name and tooltip, e.g. \"Show history\".\n */\n label: string;\n onExpand: () => void;\n className?: string;\n}\n\n/**\n * What a collapsible pane leaves behind once it is closed: a 36px strip
|
|
1
|
+
{"version":3,"file":"PaneRail.js","names":[],"sources":["../../src/core/PaneRail.tsx"],"sourcesContent":["import { PanelLeftOpen, PanelRightOpen } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\n\nimport { cn } from \"./utils.ts\";\n\nexport interface PaneRailProps {\n /**\n * The edge of the layout the collapsed pane sits on. It picks the icon and\n * puts the border on the side that faces the content the pane was beside.\n */\n side: \"left\" | \"right\";\n /**\n * The expand button's accessible name and tooltip, e.g. \"Show history\".\n */\n label: string;\n onExpand: () => void;\n /**\n * The pane's own icon, at the top of the strip. Given one, the rail names\n * WHAT it reopens, and the open-panel arrow moves to the strip's foot so\n * the strip still says it opens something. Without one the arrow is the\n * only mark, at the top.\n */\n icon?: ReactNode;\n /**\n * Shown under the top icon: a count badge, say. Not separately\n * actionable, since the whole strip is the button.\n */\n children?: ReactNode;\n className?: string;\n \"data-testid\"?: string;\n}\n\n/**\n * What a collapsible pane leaves behind once it is closed: a 36px strip that\n * is, all of it, the button that brings the pane back.\n *\n * A pane closed with a click has to say how to reopen it. Collapsing to\n * nothing strands the reader: the only routes back left are a keyboard\n * shortcut and a menu that does not advertise itself, for a pane they just\n * closed with a click.\n *\n * The whole strip is the hit area, hover included, rather than a small\n * button at its top: the strip has no other use, and a 28px target inside a\n * full-height column reads as broken when a click below it does nothing.\n *\n * It moved from Lore into the kit with #Q2265 and became one full-height\n * button with #Q3206, so the admin Parameters History panel, Lore's folio\n * tree and inspector, and Lore's Quest Log (`icon` plus a count as\n * `children`) share one strip and cannot drift apart.\n *\n * ⚠️ Render it only where the pane would otherwise be a COLUMN. Where a\n * layout stacks its panes or turns one into an overlay, a strip frees no\n * width and only changes the default layout.\n */\nexport const PaneRail = (props: PaneRailProps) => {\n const Arrow = props.side === \"left\" ? PanelLeftOpen : PanelRightOpen;\n\n return (\n <button\n type=\"button\"\n onClick={props.onExpand}\n aria-label={props.label}\n title={props.label}\n data-testid={props[\"data-testid\"]}\n className={cn(\n \"border-border text-muted-foreground hover:text-foreground hover:bg-hover focus-visible:ring-ring/50 flex w-9 flex-none cursor-pointer flex-col items-center gap-2 pt-3 transition-colors outline-none focus-visible:ring-3 focus-visible:ring-inset\",\n props.side === \"left\" ? \"border-r\" : \"border-l\",\n props.className,\n )}\n >\n {props.icon ?? <Arrow className=\"size-4 shrink-0\" />}\n {props.children}\n {props.icon && <Arrow className=\"mt-auto mb-3 size-3.5 shrink-0\" />}\n </button>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAa,YAAY,UAAyB;CAChD,MAAM,QAAQ,MAAM,SAAS,SAAS,gBAAgB;CAEtD,OACE,qBAAC,UAAD;EACE,MAAK;EACL,SAAS,MAAM;EACf,cAAY,MAAM;EAClB,OAAO,MAAM;EACb,eAAa,MAAM;EACnB,WAAW,GACT,uPACA,MAAM,SAAS,SAAS,aAAa,YACrC,MAAM,SACR;EAVF,UAAA;GAYG,MAAM,QAAQ,oBAAC,OAAD,EAAO,WAAU,kBAAmB,CAAA;GAClD,MAAM;GACN,MAAM,QAAQ,oBAAC,OAAD,EAAO,WAAU,iCAAkC,CAAA;EAC5D;;AAEZ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** One step of a {@link Stepper}. */
|
|
3
|
+
export interface StepperStep {
|
|
4
|
+
/** Unique among the steps. */
|
|
5
|
+
key: string;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
/** A short line under the label. */
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** Where a step stands against the current one. */
|
|
11
|
+
export type StepperStepState = "done" | "current" | "upcoming";
|
|
12
|
+
export interface StepperProps {
|
|
13
|
+
steps: StepperStep[];
|
|
14
|
+
/** The index of the step on screen. */
|
|
15
|
+
current: number;
|
|
16
|
+
/**
|
|
17
|
+
* Called with a step's index when it is clicked. Only the steps already
|
|
18
|
+
* done are clickable: going forward is the caller's to validate.
|
|
19
|
+
*/
|
|
20
|
+
onStepClick?: (index: number) => void;
|
|
21
|
+
/** The list's accessible name. Defaults to "Steps". */
|
|
22
|
+
label?: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/** The state of the step at `index` when `current` is on screen. */
|
|
26
|
+
export declare const stepperStepState: (index: number, current: number) => StepperStepState;
|
|
27
|
+
/**
|
|
28
|
+
* The header of a multi-step form: each step numbered, with its state drawn
|
|
29
|
+
* (a check once done, the current one highlighted, the ones to come muted)
|
|
30
|
+
* and joined by a line that fills as the steps are done.
|
|
31
|
+
*
|
|
32
|
+
* It draws the steps and nothing else: the body and the Back / Next buttons
|
|
33
|
+
* stay the caller's, which is where validating a step belongs.
|
|
34
|
+
*/
|
|
35
|
+
export declare const Stepper: (props: StepperProps) => import("react").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=Stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../src/core/Stepper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,qCAAqC;AACrC,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,SAAS,CAAC;IACjB,oCAAoC;IACpC,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB;AAED,mDAAmD;AACnD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAE/D,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,oEAAoE;AACpE,eAAO,MAAM,gBAAgB,UACpB,MAAM,WACJ,MAAM,KACd,gBACoE,CAAC;AAExE;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,UAAW,YAAY,gCAuE1C,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { cn } from "./utils.js";
|
|
2
|
+
import { Check } from "lucide-react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// src/core/Stepper.tsx
|
|
5
|
+
/** The state of the step at `index` when `current` is on screen. */
|
|
6
|
+
const stepperStepState = (index, current) => index < current ? "done" : index === current ? "current" : "upcoming";
|
|
7
|
+
/**
|
|
8
|
+
* The header of a multi-step form: each step numbered, with its state drawn
|
|
9
|
+
* (a check once done, the current one highlighted, the ones to come muted)
|
|
10
|
+
* and joined by a line that fills as the steps are done.
|
|
11
|
+
*
|
|
12
|
+
* It draws the steps and nothing else: the body and the Back / Next buttons
|
|
13
|
+
* stay the caller's, which is where validating a step belongs.
|
|
14
|
+
*/
|
|
15
|
+
const Stepper = (props) => /* @__PURE__ */ jsx("ol", {
|
|
16
|
+
"data-slot": "stepper",
|
|
17
|
+
"aria-label": props.label ?? "Steps",
|
|
18
|
+
className: cn("flex w-full items-start gap-2", props.className),
|
|
19
|
+
children: props.steps.map((step, index) => {
|
|
20
|
+
const state = stepperStepState(index, props.current);
|
|
21
|
+
const clickable = state === "done" && Boolean(props.onStepClick);
|
|
22
|
+
const last = index === props.steps.length - 1;
|
|
23
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
24
|
+
"data-state": state,
|
|
25
|
+
"aria-current": state === "current" ? "step" : void 0,
|
|
26
|
+
className: cn("flex min-w-0 flex-1 items-start gap-2", last && "flex-none"),
|
|
27
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
28
|
+
type: "button",
|
|
29
|
+
disabled: !clickable,
|
|
30
|
+
onClick: clickable ? () => props.onStepClick?.(index) : void 0,
|
|
31
|
+
className: cn("flex min-w-0 items-start gap-2 text-left", clickable && "cursor-pointer", !clickable && "cursor-default"),
|
|
32
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
33
|
+
className: cn("flex size-7 shrink-0 items-center justify-center rounded-full border text-xs font-semibold tabular-nums transition-colors", state === "done" && "bg-primary border-primary text-primary-foreground", state === "current" && "border-primary text-primary ring-primary/20 ring-4", state === "upcoming" && "text-muted-foreground"),
|
|
34
|
+
children: state === "done" ? /* @__PURE__ */ jsx(Check, { className: "size-3.5" }) : index + 1
|
|
35
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
36
|
+
className: "flex min-w-0 flex-col pt-1",
|
|
37
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
38
|
+
className: cn("truncate text-sm font-medium", state === "upcoming" && "text-muted-foreground"),
|
|
39
|
+
children: step.label
|
|
40
|
+
}), step.description && /* @__PURE__ */ jsx("span", {
|
|
41
|
+
className: "text-muted-foreground truncate text-xs",
|
|
42
|
+
children: step.description
|
|
43
|
+
})]
|
|
44
|
+
})]
|
|
45
|
+
}), !last && /* @__PURE__ */ jsx("span", {
|
|
46
|
+
"aria-hidden": true,
|
|
47
|
+
className: cn("mt-3.5 h-px min-w-4 flex-1", state === "done" ? "bg-primary" : "bg-border")
|
|
48
|
+
})]
|
|
49
|
+
}, step.key);
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
export { Stepper, stepperStepState };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=Stepper.js.map
|