@jameskabz/nextcraft-ui 0.6.6 → 0.6.8
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/components/craft-alert.cjs +69 -0
- package/dist/components/craft-alert.cjs.map +1 -0
- package/dist/components/craft-alert.d.cts +16 -0
- package/dist/components/craft-alert.d.ts +16 -0
- package/dist/components/craft-alert.js +45 -0
- package/dist/components/craft-alert.js.map +1 -0
- package/dist/components/craft-badge.cjs +54 -0
- package/dist/components/craft-badge.cjs.map +1 -0
- package/dist/components/craft-badge.d.cts +12 -0
- package/dist/components/craft-badge.d.ts +12 -0
- package/dist/components/craft-badge.js +30 -0
- package/dist/components/craft-badge.js.map +1 -0
- package/dist/components/craft-button.cjs +66 -0
- package/dist/components/craft-button.cjs.map +1 -0
- package/dist/components/craft-button.d.cts +15 -0
- package/dist/components/craft-button.d.ts +15 -0
- package/dist/components/craft-button.js +42 -0
- package/dist/components/craft-button.js.map +1 -0
- package/dist/components/craft-card.cjs +63 -0
- package/dist/components/craft-card.cjs.map +1 -0
- package/dist/components/craft-card.d.cts +13 -0
- package/dist/components/craft-card.d.ts +13 -0
- package/dist/components/craft-card.js +39 -0
- package/dist/components/craft-card.js.map +1 -0
- package/dist/components/craft-checkbox.cjs +103 -0
- package/dist/components/craft-checkbox.cjs.map +1 -0
- package/dist/components/craft-checkbox.d.cts +16 -0
- package/dist/components/craft-checkbox.d.ts +16 -0
- package/dist/components/craft-checkbox.js +69 -0
- package/dist/components/craft-checkbox.js.map +1 -0
- package/dist/components/craft-command-palette.cjs +134 -0
- package/dist/components/craft-command-palette.cjs.map +1 -0
- package/dist/components/craft-command-palette.d.cts +28 -0
- package/dist/components/craft-command-palette.d.ts +28 -0
- package/dist/components/craft-command-palette.js +100 -0
- package/dist/components/craft-command-palette.js.map +1 -0
- package/dist/components/craft-confirm-dialog.cjs +114 -0
- package/dist/components/craft-confirm-dialog.cjs.map +1 -0
- package/dist/components/craft-confirm-dialog.d.cts +21 -0
- package/dist/components/craft-confirm-dialog.d.ts +21 -0
- package/dist/components/craft-confirm-dialog.js +80 -0
- package/dist/components/craft-confirm-dialog.js.map +1 -0
- package/dist/components/craft-create-edit-drawer.cjs +112 -0
- package/dist/components/craft-create-edit-drawer.cjs.map +1 -0
- package/dist/components/craft-create-edit-drawer.d.cts +28 -0
- package/dist/components/craft-create-edit-drawer.d.ts +28 -0
- package/dist/components/craft-create-edit-drawer.js +78 -0
- package/dist/components/craft-create-edit-drawer.js.map +1 -0
- package/dist/components/craft-currency-input.cjs +68 -0
- package/dist/components/craft-currency-input.cjs.map +1 -0
- package/dist/components/craft-currency-input.d.cts +14 -0
- package/dist/components/craft-currency-input.d.ts +14 -0
- package/dist/components/craft-currency-input.js +34 -0
- package/dist/components/craft-currency-input.js.map +1 -0
- package/dist/components/craft-data-table.cjs +407 -0
- package/dist/components/craft-data-table.cjs.map +1 -0
- package/dist/components/craft-data-table.d.cts +58 -0
- package/dist/components/craft-data-table.d.ts +58 -0
- package/dist/components/craft-data-table.js +373 -0
- package/dist/components/craft-data-table.js.map +1 -0
- package/dist/components/craft-date-picker.cjs +226 -0
- package/dist/components/craft-date-picker.cjs.map +1 -0
- package/dist/components/craft-date-picker.d.cts +17 -0
- package/dist/components/craft-date-picker.d.ts +17 -0
- package/dist/components/craft-date-picker.js +192 -0
- package/dist/components/craft-date-picker.js.map +1 -0
- package/dist/components/craft-drawer.cjs +126 -0
- package/dist/components/craft-drawer.cjs.map +1 -0
- package/dist/components/craft-drawer.d.cts +19 -0
- package/dist/components/craft-drawer.d.ts +19 -0
- package/dist/components/craft-drawer.js +92 -0
- package/dist/components/craft-drawer.js.map +1 -0
- package/dist/components/craft-dropdown-menu.cjs +127 -0
- package/dist/components/craft-dropdown-menu.cjs.map +1 -0
- package/dist/components/craft-dropdown-menu.d.cts +28 -0
- package/dist/components/craft-dropdown-menu.d.ts +28 -0
- package/dist/components/craft-dropdown-menu.js +93 -0
- package/dist/components/craft-dropdown-menu.js.map +1 -0
- package/dist/components/craft-empty-state.cjs +58 -0
- package/dist/components/craft-empty-state.cjs.map +1 -0
- package/dist/components/craft-empty-state.d.cts +14 -0
- package/dist/components/craft-empty-state.d.ts +14 -0
- package/dist/components/craft-empty-state.js +34 -0
- package/dist/components/craft-empty-state.js.map +1 -0
- package/dist/components/craft-error-state.cjs +60 -0
- package/dist/components/craft-error-state.cjs.map +1 -0
- package/dist/components/craft-error-state.d.cts +15 -0
- package/dist/components/craft-error-state.d.ts +15 -0
- package/dist/components/craft-error-state.js +36 -0
- package/dist/components/craft-error-state.js.map +1 -0
- package/dist/components/craft-filter-bar.cjs +76 -0
- package/dist/components/craft-filter-bar.cjs.map +1 -0
- package/dist/components/craft-filter-bar.d.cts +18 -0
- package/dist/components/craft-filter-bar.d.ts +18 -0
- package/dist/components/craft-filter-bar.js +52 -0
- package/dist/components/craft-filter-bar.js.map +1 -0
- package/dist/components/craft-form-builder.cjs +330 -0
- package/dist/components/craft-form-builder.cjs.map +1 -0
- package/dist/components/craft-form-builder.d.cts +57 -0
- package/dist/components/craft-form-builder.d.ts +57 -0
- package/dist/components/craft-form-builder.js +301 -0
- package/dist/components/craft-form-builder.js.map +1 -0
- package/dist/components/craft-form-field.cjs +301 -0
- package/dist/components/craft-form-field.cjs.map +1 -0
- package/dist/components/craft-form-field.d.cts +30 -0
- package/dist/components/craft-form-field.d.ts +30 -0
- package/dist/components/craft-form-field.js +280 -0
- package/dist/components/craft-form-field.js.map +1 -0
- package/dist/components/craft-form.cjs +114 -0
- package/dist/components/craft-form.cjs.map +1 -0
- package/dist/components/craft-form.d.cts +27 -0
- package/dist/components/craft-form.d.ts +27 -0
- package/dist/components/craft-form.js +80 -0
- package/dist/components/craft-form.js.map +1 -0
- package/dist/components/craft-icon.cjs +102 -0
- package/dist/components/craft-icon.cjs.map +1 -0
- package/dist/components/craft-icon.d.cts +19 -0
- package/dist/components/craft-icon.d.ts +19 -0
- package/dist/components/craft-icon.js +67 -0
- package/dist/components/craft-icon.js.map +1 -0
- package/dist/components/craft-input.cjs +78 -0
- package/dist/components/craft-input.cjs.map +1 -0
- package/dist/components/craft-input.d.cts +19 -0
- package/dist/components/craft-input.d.ts +19 -0
- package/dist/components/craft-input.js +44 -0
- package/dist/components/craft-input.js.map +1 -0
- package/dist/components/craft-link.cjs +70 -0
- package/dist/components/craft-link.cjs.map +1 -0
- package/dist/components/craft-link.d.cts +14 -0
- package/dist/components/craft-link.d.ts +14 -0
- package/dist/components/craft-link.js +36 -0
- package/dist/components/craft-link.js.map +1 -0
- package/dist/components/craft-loading-state.cjs +64 -0
- package/dist/components/craft-loading-state.cjs.map +1 -0
- package/dist/components/craft-loading-state.d.cts +13 -0
- package/dist/components/craft-loading-state.d.ts +13 -0
- package/dist/components/craft-loading-state.js +40 -0
- package/dist/components/craft-loading-state.js.map +1 -0
- package/dist/components/craft-modal.cjs +174 -0
- package/dist/components/craft-modal.cjs.map +1 -0
- package/dist/components/craft-modal.d.cts +19 -0
- package/dist/components/craft-modal.d.ts +19 -0
- package/dist/components/craft-modal.js +140 -0
- package/dist/components/craft-modal.js.map +1 -0
- package/dist/components/craft-number-input.cjs +63 -0
- package/dist/components/craft-number-input.cjs.map +1 -0
- package/dist/components/craft-number-input.d.cts +12 -0
- package/dist/components/craft-number-input.d.ts +12 -0
- package/dist/components/craft-number-input.js +29 -0
- package/dist/components/craft-number-input.js.map +1 -0
- package/dist/components/craft-pagination.cjs +130 -0
- package/dist/components/craft-pagination.cjs.map +1 -0
- package/dist/components/craft-pagination.d.cts +19 -0
- package/dist/components/craft-pagination.d.ts +19 -0
- package/dist/components/craft-pagination.js +106 -0
- package/dist/components/craft-pagination.js.map +1 -0
- package/dist/components/craft-popover.cjs +123 -0
- package/dist/components/craft-popover.cjs.map +1 -0
- package/dist/components/craft-popover.d.cts +20 -0
- package/dist/components/craft-popover.d.ts +20 -0
- package/dist/components/craft-popover.js +89 -0
- package/dist/components/craft-popover.js.map +1 -0
- package/dist/components/craft-select.cjs +84 -0
- package/dist/components/craft-select.cjs.map +1 -0
- package/dist/components/craft-select.d.cts +12 -0
- package/dist/components/craft-select.d.ts +12 -0
- package/dist/components/craft-select.js +50 -0
- package/dist/components/craft-select.js.map +1 -0
- package/dist/components/craft-skeleton.cjs +45 -0
- package/dist/components/craft-skeleton.cjs.map +1 -0
- package/dist/components/craft-skeleton.d.cts +10 -0
- package/dist/components/craft-skeleton.d.ts +10 -0
- package/dist/components/craft-skeleton.js +21 -0
- package/dist/components/craft-skeleton.js.map +1 -0
- package/dist/components/craft-stat-card.cjs +67 -0
- package/dist/components/craft-stat-card.cjs.map +1 -0
- package/dist/components/craft-stat-card.d.cts +17 -0
- package/dist/components/craft-stat-card.d.ts +17 -0
- package/dist/components/craft-stat-card.js +43 -0
- package/dist/components/craft-stat-card.js.map +1 -0
- package/dist/components/craft-submit-button.cjs +71 -0
- package/dist/components/craft-submit-button.cjs.map +1 -0
- package/dist/components/craft-submit-button.d.cts +13 -0
- package/dist/components/craft-submit-button.d.ts +13 -0
- package/dist/components/craft-submit-button.js +47 -0
- package/dist/components/craft-submit-button.js.map +1 -0
- package/dist/components/craft-switch.cjs +82 -0
- package/dist/components/craft-switch.cjs.map +1 -0
- package/dist/components/craft-switch.d.cts +14 -0
- package/dist/components/craft-switch.d.ts +14 -0
- package/dist/components/craft-switch.js +48 -0
- package/dist/components/craft-switch.js.map +1 -0
- package/dist/components/craft-table-toolbar.cjs +79 -0
- package/dist/components/craft-table-toolbar.cjs.map +1 -0
- package/dist/components/craft-table-toolbar.d.cts +19 -0
- package/dist/components/craft-table-toolbar.d.ts +19 -0
- package/dist/components/craft-table-toolbar.js +55 -0
- package/dist/components/craft-table-toolbar.js.map +1 -0
- package/dist/components/craft-tabs.cjs +105 -0
- package/dist/components/craft-tabs.cjs.map +1 -0
- package/dist/components/craft-tabs.d.cts +19 -0
- package/dist/components/craft-tabs.d.ts +19 -0
- package/dist/components/craft-tabs.js +71 -0
- package/dist/components/craft-tabs.js.map +1 -0
- package/dist/components/craft-textarea.cjs +69 -0
- package/dist/components/craft-textarea.cjs.map +1 -0
- package/dist/components/craft-textarea.d.cts +12 -0
- package/dist/components/craft-textarea.d.ts +12 -0
- package/dist/components/craft-textarea.js +35 -0
- package/dist/components/craft-textarea.js.map +1 -0
- package/dist/components/craft-toast.cjs +98 -0
- package/dist/components/craft-toast.cjs.map +1 -0
- package/dist/components/craft-toast.d.cts +24 -0
- package/dist/components/craft-toast.d.ts +24 -0
- package/dist/components/craft-toast.js +63 -0
- package/dist/components/craft-toast.js.map +1 -0
- package/dist/components/craft-tooltip.cjs +75 -0
- package/dist/components/craft-tooltip.cjs.map +1 -0
- package/dist/components/craft-tooltip.d.cts +13 -0
- package/dist/components/craft-tooltip.d.ts +13 -0
- package/dist/components/craft-tooltip.js +41 -0
- package/dist/components/craft-tooltip.js.map +1 -0
- package/dist/components/glass-card.cjs +64 -0
- package/dist/components/glass-card.cjs.map +1 -0
- package/dist/components/glass-card.d.cts +12 -0
- package/dist/components/glass-card.d.ts +12 -0
- package/dist/components/glass-card.js +40 -0
- package/dist/components/glass-card.js.map +1 -0
- package/dist/components/layout/app-shell.cjs +49 -0
- package/dist/components/layout/app-shell.cjs.map +1 -0
- package/dist/components/layout/app-shell.d.cts +10 -0
- package/dist/components/layout/app-shell.d.ts +10 -0
- package/dist/components/layout/app-shell.js +25 -0
- package/dist/components/layout/app-shell.js.map +1 -0
- package/dist/components/layout/app-template.cjs +104 -0
- package/dist/components/layout/app-template.cjs.map +1 -0
- package/dist/components/layout/app-template.d.cts +19 -0
- package/dist/components/layout/app-template.d.ts +19 -0
- package/dist/components/layout/app-template.js +70 -0
- package/dist/components/layout/app-template.js.map +1 -0
- package/dist/components/layout/auth-layout.cjs +65 -0
- package/dist/components/layout/auth-layout.cjs.map +1 -0
- package/dist/components/layout/auth-layout.d.cts +12 -0
- package/dist/components/layout/auth-layout.d.ts +12 -0
- package/dist/components/layout/auth-layout.js +41 -0
- package/dist/components/layout/auth-layout.js.map +1 -0
- package/dist/components/layout/breadcrumbs.cjs +39 -0
- package/dist/components/layout/breadcrumbs.cjs.map +1 -0
- package/dist/components/layout/breadcrumbs.d.cts +13 -0
- package/dist/components/layout/breadcrumbs.d.ts +13 -0
- package/dist/components/layout/breadcrumbs.js +15 -0
- package/dist/components/layout/breadcrumbs.js.map +1 -0
- package/dist/components/layout/container.cjs +45 -0
- package/dist/components/layout/container.cjs.map +1 -0
- package/dist/components/layout/container.d.cts +9 -0
- package/dist/components/layout/container.d.ts +9 -0
- package/dist/components/layout/container.js +21 -0
- package/dist/components/layout/container.js.map +1 -0
- package/dist/components/layout/grid.cjs +47 -0
- package/dist/components/layout/grid.cjs.map +1 -0
- package/dist/components/layout/grid.d.cts +10 -0
- package/dist/components/layout/grid.d.ts +10 -0
- package/dist/components/layout/grid.js +23 -0
- package/dist/components/layout/grid.js.map +1 -0
- package/dist/components/layout/layout-config.cjs +78 -0
- package/dist/components/layout/layout-config.cjs.map +1 -0
- package/dist/components/layout/layout-config.d.cts +92 -0
- package/dist/components/layout/layout-config.d.ts +92 -0
- package/dist/components/layout/layout-config.js +54 -0
- package/dist/components/layout/layout-config.js.map +1 -0
- package/dist/components/layout/page-header.cjs +52 -0
- package/dist/components/layout/page-header.cjs.map +1 -0
- package/dist/components/layout/page-header.d.cts +11 -0
- package/dist/components/layout/page-header.d.ts +11 -0
- package/dist/components/layout/page-header.js +28 -0
- package/dist/components/layout/page-header.js.map +1 -0
- package/dist/components/layout/sidebar.cjs +64 -0
- package/dist/components/layout/sidebar.cjs.map +1 -0
- package/dist/components/layout/sidebar.d.cts +17 -0
- package/dist/components/layout/sidebar.d.ts +17 -0
- package/dist/components/layout/sidebar.js +40 -0
- package/dist/components/layout/sidebar.js.map +1 -0
- package/dist/components/layout/top-nav.cjs +49 -0
- package/dist/components/layout/top-nav.cjs.map +1 -0
- package/dist/components/layout/top-nav.d.cts +11 -0
- package/dist/components/layout/top-nav.d.ts +11 -0
- package/dist/components/layout/top-nav.js +25 -0
- package/dist/components/layout/top-nav.js.map +1 -0
- package/dist/components/theme-switcher.cjs +72 -0
- package/dist/components/theme-switcher.cjs.map +1 -0
- package/dist/components/theme-switcher.d.cts +9 -0
- package/dist/components/theme-switcher.d.ts +9 -0
- package/dist/components/theme-switcher.js +48 -0
- package/dist/components/theme-switcher.js.map +1 -0
- package/dist/index.cjs +103 -3448
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -746
- package/dist/index.d.ts +54 -746
- package/dist/index.js +50 -3388
- package/dist/index.js.map +1 -1
- package/dist/theme/theme-context.cjs +115 -0
- package/dist/theme/theme-context.cjs.map +1 -0
- package/dist/theme/theme-context.d.cts +23 -0
- package/dist/theme/theme-context.d.ts +23 -0
- package/dist/theme/theme-context.js +79 -0
- package/dist/theme/theme-context.js.map +1 -0
- package/dist/utils/cn.cjs +31 -0
- package/dist/utils/cn.cjs.map +1 -0
- package/dist/utils/cn.d.cts +3 -0
- package/dist/utils/cn.d.ts +3 -0
- package/dist/utils/cn.js +7 -0
- package/dist/utils/cn.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var craft_select_exports = {};
|
|
30
|
+
__export(craft_select_exports, {
|
|
31
|
+
CraftSelect: () => CraftSelect
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(craft_select_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var React = __toESM(require("react"), 1);
|
|
36
|
+
var import_cn = require("../utils/cn");
|
|
37
|
+
const CraftSelect = React.forwardRef(
|
|
38
|
+
({ className, tone, children, ...props }, ref) => {
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative w-full", "data-nc-theme": tone, children: [
|
|
40
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
"select",
|
|
42
|
+
{
|
|
43
|
+
ref,
|
|
44
|
+
className: (0, import_cn.cn)(
|
|
45
|
+
"w-full appearance-none rounded-2xl border-2 bg-[rgb(var(--nc-surface)/0.08)] text-[rgb(var(--nc-fg))] backdrop-blur-xl",
|
|
46
|
+
"shadow-[inset_0_2px_8px_rgba(0,0,0,0.3)]",
|
|
47
|
+
"focus:outline-none focus:ring-4",
|
|
48
|
+
"transition-all duration-300",
|
|
49
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
50
|
+
"border-[rgb(var(--nc-border)/0.35)]",
|
|
51
|
+
"focus:border-[rgb(var(--nc-accent-1)/0.8)] focus:ring-[rgb(var(--nc-accent-1)/0.3)]",
|
|
52
|
+
"px-5 py-3 pr-10 text-base",
|
|
53
|
+
className
|
|
54
|
+
),
|
|
55
|
+
...props,
|
|
56
|
+
children
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
60
|
+
"svg",
|
|
61
|
+
{
|
|
62
|
+
className: "pointer-events-none absolute right-4 top-1/2 h-4 w-4 -translate-y-1/2 text-[rgb(var(--nc-fg-soft))]",
|
|
63
|
+
viewBox: "0 0 20 20",
|
|
64
|
+
fill: "currentColor",
|
|
65
|
+
"aria-hidden": "true",
|
|
66
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
67
|
+
"path",
|
|
68
|
+
{
|
|
69
|
+
fillRule: "evenodd",
|
|
70
|
+
d: "M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.7a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z",
|
|
71
|
+
clipRule: "evenodd"
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] });
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
CraftSelect.displayName = "CraftSelect";
|
|
80
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
+
0 && (module.exports = {
|
|
82
|
+
CraftSelect
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=craft-select.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-select.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\n\nexport type CraftSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n tone?: ThemeName;\n};\n\nexport const CraftSelect = React.forwardRef<HTMLSelectElement, CraftSelectProps>(\n ({ className, tone, children, ...props }, ref) => {\n return (\n <div className=\"relative w-full\" data-nc-theme={tone}>\n <select\n ref={ref}\n className={cn(\n \"w-full appearance-none rounded-2xl border-2 bg-[rgb(var(--nc-surface)/0.08)] text-[rgb(var(--nc-fg))] backdrop-blur-xl\",\n \"shadow-[inset_0_2px_8px_rgba(0,0,0,0.3)]\",\n \"focus:outline-none focus:ring-4\",\n \"transition-all duration-300\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n \"border-[rgb(var(--nc-border)/0.35)]\",\n \"focus:border-[rgb(var(--nc-accent-1)/0.8)] focus:ring-[rgb(var(--nc-accent-1)/0.3)]\",\n \"px-5 py-3 pr-10 text-base\",\n className\n )}\n {...props}\n >\n {children}\n </select>\n <svg\n className=\"pointer-events-none absolute right-4 top-1/2 h-4 w-4 -translate-y-1/2 text-[rgb(var(--nc-fg-soft))]\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.7a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </div>\n );\n }\n);\n\nCraftSelect.displayName = \"CraftSelect\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYM;AAZN,YAAuB;AAEvB,gBAAmB;AAOZ,MAAM,cAAc,MAAM;AAAA,EAC/B,CAAC,EAAE,WAAW,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ;AAChD,WACE,6CAAC,SAAI,WAAU,mBAAkB,iBAAe,MAC9C;AAAA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,eAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACC,GAAG;AAAA,UAEH;AAAA;AAAA,MACH;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,eAAY;AAAA,UAEZ;AAAA,YAAC;AAAA;AAAA,cACC,UAAS;AAAA,cACT,GAAE;AAAA,cACF,UAAS;AAAA;AAAA,UACX;AAAA;AAAA,MACF;AAAA,OACF;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
type CraftSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
|
|
6
|
+
tone?: ThemeName;
|
|
7
|
+
};
|
|
8
|
+
declare const CraftSelect: React.ForwardRefExoticComponent<React.SelectHTMLAttributes<HTMLSelectElement> & {
|
|
9
|
+
tone?: ThemeName;
|
|
10
|
+
} & React.RefAttributes<HTMLSelectElement>>;
|
|
11
|
+
|
|
12
|
+
export { CraftSelect, type CraftSelectProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
type CraftSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {
|
|
6
|
+
tone?: ThemeName;
|
|
7
|
+
};
|
|
8
|
+
declare const CraftSelect: React.ForwardRefExoticComponent<React.SelectHTMLAttributes<HTMLSelectElement> & {
|
|
9
|
+
tone?: ThemeName;
|
|
10
|
+
} & React.RefAttributes<HTMLSelectElement>>;
|
|
11
|
+
|
|
12
|
+
export { CraftSelect, type CraftSelectProps };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../utils/cn";
|
|
4
|
+
const CraftSelect = React.forwardRef(
|
|
5
|
+
({ className, tone, children, ...props }, ref) => {
|
|
6
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", "data-nc-theme": tone, children: [
|
|
7
|
+
/* @__PURE__ */ jsx(
|
|
8
|
+
"select",
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
className: cn(
|
|
12
|
+
"w-full appearance-none rounded-2xl border-2 bg-[rgb(var(--nc-surface)/0.08)] text-[rgb(var(--nc-fg))] backdrop-blur-xl",
|
|
13
|
+
"shadow-[inset_0_2px_8px_rgba(0,0,0,0.3)]",
|
|
14
|
+
"focus:outline-none focus:ring-4",
|
|
15
|
+
"transition-all duration-300",
|
|
16
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
17
|
+
"border-[rgb(var(--nc-border)/0.35)]",
|
|
18
|
+
"focus:border-[rgb(var(--nc-accent-1)/0.8)] focus:ring-[rgb(var(--nc-accent-1)/0.3)]",
|
|
19
|
+
"px-5 py-3 pr-10 text-base",
|
|
20
|
+
className
|
|
21
|
+
),
|
|
22
|
+
...props,
|
|
23
|
+
children
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
"svg",
|
|
28
|
+
{
|
|
29
|
+
className: "pointer-events-none absolute right-4 top-1/2 h-4 w-4 -translate-y-1/2 text-[rgb(var(--nc-fg-soft))]",
|
|
30
|
+
viewBox: "0 0 20 20",
|
|
31
|
+
fill: "currentColor",
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
children: /* @__PURE__ */ jsx(
|
|
34
|
+
"path",
|
|
35
|
+
{
|
|
36
|
+
fillRule: "evenodd",
|
|
37
|
+
d: "M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.7a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z",
|
|
38
|
+
clipRule: "evenodd"
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
CraftSelect.displayName = "CraftSelect";
|
|
47
|
+
export {
|
|
48
|
+
CraftSelect
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=craft-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-select.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\n\nexport type CraftSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n tone?: ThemeName;\n};\n\nexport const CraftSelect = React.forwardRef<HTMLSelectElement, CraftSelectProps>(\n ({ className, tone, children, ...props }, ref) => {\n return (\n <div className=\"relative w-full\" data-nc-theme={tone}>\n <select\n ref={ref}\n className={cn(\n \"w-full appearance-none rounded-2xl border-2 bg-[rgb(var(--nc-surface)/0.08)] text-[rgb(var(--nc-fg))] backdrop-blur-xl\",\n \"shadow-[inset_0_2px_8px_rgba(0,0,0,0.3)]\",\n \"focus:outline-none focus:ring-4\",\n \"transition-all duration-300\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n \"border-[rgb(var(--nc-border)/0.35)]\",\n \"focus:border-[rgb(var(--nc-accent-1)/0.8)] focus:ring-[rgb(var(--nc-accent-1)/0.3)]\",\n \"px-5 py-3 pr-10 text-base\",\n className\n )}\n {...props}\n >\n {children}\n </select>\n <svg\n className=\"pointer-events-none absolute right-4 top-1/2 h-4 w-4 -translate-y-1/2 text-[rgb(var(--nc-fg-soft))]\"\n viewBox=\"0 0 20 20\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n d=\"M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.7a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z\"\n clipRule=\"evenodd\"\n />\n </svg>\n </div>\n );\n }\n);\n\nCraftSelect.displayName = \"CraftSelect\";\n"],"mappings":"AAYM,SACE,KADF;AAZN,YAAY,WAAW;AAEvB,SAAS,UAAU;AAOZ,MAAM,cAAc,MAAM;AAAA,EAC/B,CAAC,EAAE,WAAW,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ;AAChD,WACE,qBAAC,SAAI,WAAU,mBAAkB,iBAAe,MAC9C;AAAA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACC,GAAG;AAAA,UAEH;AAAA;AAAA,MACH;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,eAAY;AAAA,UAEZ;AAAA,YAAC;AAAA;AAAA,cACC,UAAS;AAAA,cACT,GAAE;AAAA,cACF,UAAS;AAAA;AAAA,UACX;AAAA;AAAA,MACF;AAAA,OACF;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;","names":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var craft_skeleton_exports = {};
|
|
20
|
+
__export(craft_skeleton_exports, {
|
|
21
|
+
CraftSkeleton: () => CraftSkeleton
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(craft_skeleton_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_cn = require("../utils/cn");
|
|
26
|
+
function CraftSkeleton({ className, tone, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: (0, import_cn.cn)(
|
|
31
|
+
"relative overflow-hidden rounded-2xl bg-[rgb(var(--nc-surface)/0.12)]",
|
|
32
|
+
"after:absolute after:inset-0 after:-translate-x-full after:bg-linear-to-r after:from-transparent after:via-white/20 after:to-transparent",
|
|
33
|
+
"after:animate-[shimmer_1.6s_infinite]",
|
|
34
|
+
className
|
|
35
|
+
),
|
|
36
|
+
"data-nc-theme": tone,
|
|
37
|
+
...props
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
CraftSkeleton
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=craft-skeleton.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-skeleton.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\n\nexport type CraftSkeletonProps = React.HTMLAttributes<HTMLDivElement> & {\n tone?: ThemeName;\n};\n\nexport function CraftSkeleton({ className, tone, ...props }: CraftSkeletonProps) {\n return (\n <div\n className={cn(\n \"relative overflow-hidden rounded-2xl bg-[rgb(var(--nc-surface)/0.12)]\",\n \"after:absolute after:inset-0 after:-translate-x-full after:bg-linear-to-r after:from-transparent after:via-white/20 after:to-transparent\",\n \"after:animate-[shimmer_1.6s_infinite]\",\n className\n )}\n data-nc-theme={tone}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWI;AATJ,gBAAmB;AAOZ,SAAS,cAAc,EAAE,WAAW,MAAM,GAAG,MAAM,GAAuB;AAC/E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,iBAAe;AAAA,MACd,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
|
+
|
|
5
|
+
type CraftSkeletonProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
tone?: ThemeName;
|
|
7
|
+
};
|
|
8
|
+
declare function CraftSkeleton({ className, tone, ...props }: CraftSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { CraftSkeleton, type CraftSkeletonProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
4
|
+
|
|
5
|
+
type CraftSkeletonProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
tone?: ThemeName;
|
|
7
|
+
};
|
|
8
|
+
declare function CraftSkeleton({ className, tone, ...props }: CraftSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { CraftSkeleton, type CraftSkeletonProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
function CraftSkeleton({ className, tone, ...props }) {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
className: cn(
|
|
8
|
+
"relative overflow-hidden rounded-2xl bg-[rgb(var(--nc-surface)/0.12)]",
|
|
9
|
+
"after:absolute after:inset-0 after:-translate-x-full after:bg-linear-to-r after:from-transparent after:via-white/20 after:to-transparent",
|
|
10
|
+
"after:animate-[shimmer_1.6s_infinite]",
|
|
11
|
+
className
|
|
12
|
+
),
|
|
13
|
+
"data-nc-theme": tone,
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
CraftSkeleton
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=craft-skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-skeleton.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\n\nexport type CraftSkeletonProps = React.HTMLAttributes<HTMLDivElement> & {\n tone?: ThemeName;\n};\n\nexport function CraftSkeleton({ className, tone, ...props }: CraftSkeletonProps) {\n return (\n <div\n className={cn(\n \"relative overflow-hidden rounded-2xl bg-[rgb(var(--nc-surface)/0.12)]\",\n \"after:absolute after:inset-0 after:-translate-x-full after:bg-linear-to-r after:from-transparent after:via-white/20 after:to-transparent\",\n \"after:animate-[shimmer_1.6s_infinite]\",\n className\n )}\n data-nc-theme={tone}\n {...props}\n />\n );\n}\n"],"mappings":"AAWI;AATJ,SAAS,UAAU;AAOZ,SAAS,cAAc,EAAE,WAAW,MAAM,GAAG,MAAM,GAAuB;AAC/E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,iBAAe;AAAA,MACd,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var craft_stat_card_exports = {};
|
|
20
|
+
__export(craft_stat_card_exports, {
|
|
21
|
+
CraftStatCard: () => CraftStatCard
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(craft_stat_card_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_cn = require("../utils/cn");
|
|
26
|
+
var import_craft_card = require("../components/craft-card");
|
|
27
|
+
const trendClasses = {
|
|
28
|
+
up: "text-emerald-300",
|
|
29
|
+
down: "text-rose-300",
|
|
30
|
+
neutral: "text-[rgb(var(--nc-fg-muted))]"
|
|
31
|
+
};
|
|
32
|
+
function CraftStatCard({
|
|
33
|
+
label,
|
|
34
|
+
value,
|
|
35
|
+
delta,
|
|
36
|
+
trend = "neutral",
|
|
37
|
+
icon,
|
|
38
|
+
footer,
|
|
39
|
+
tone,
|
|
40
|
+
className,
|
|
41
|
+
...props
|
|
42
|
+
}) {
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
44
|
+
import_craft_card.CraftCard,
|
|
45
|
+
{
|
|
46
|
+
className: (0, import_cn.cn)("space-y-3", className),
|
|
47
|
+
tone,
|
|
48
|
+
...props,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
51
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-[rgb(var(--nc-fg-muted))]", children: label }),
|
|
52
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-[rgb(var(--nc-fg-soft))]", children: icon })
|
|
53
|
+
] }),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-3xl font-semibold", children: value }),
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between text-xs", children: [
|
|
56
|
+
delta && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: trendClasses[trend], children: delta }),
|
|
57
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-[rgb(var(--nc-fg-muted))]", children: footer })
|
|
58
|
+
] })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
+
0 && (module.exports = {
|
|
65
|
+
CraftStatCard
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=craft-stat-card.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-stat-card.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\nimport { CraftCard } from \"@/components/craft-card\";\n\ntype CraftStatTrend = \"up\" | \"down\" | \"neutral\";\n\nexport type CraftStatCardProps = React.HTMLAttributes<HTMLDivElement> & {\n label: React.ReactNode;\n value: React.ReactNode;\n delta?: React.ReactNode;\n trend?: CraftStatTrend;\n icon?: React.ReactNode;\n footer?: React.ReactNode;\n tone?: ThemeName;\n};\n\nconst trendClasses: Record<CraftStatTrend, string> = {\n up: \"text-emerald-300\",\n down: \"text-rose-300\",\n neutral: \"text-[rgb(var(--nc-fg-muted))]\",\n};\n\nexport function CraftStatCard({\n label,\n value,\n delta,\n trend = \"neutral\",\n icon,\n footer,\n tone,\n className,\n ...props\n}: CraftStatCardProps) {\n return (\n <CraftCard\n className={cn(\"space-y-3\", className)}\n tone={tone}\n {...props}\n >\n <div className=\"flex items-center justify-between\">\n <p className=\"text-sm text-[rgb(var(--nc-fg-muted))]\">{label}</p>\n {icon && <div className=\"text-[rgb(var(--nc-fg-soft))]\">{icon}</div>}\n </div>\n <p className=\"text-3xl font-semibold\">{value}</p>\n <div className=\"flex items-center justify-between text-xs\">\n {delta && <span className={trendClasses[trend]}>{delta}</span>}\n {footer && <span className=\"text-[rgb(var(--nc-fg-muted))]\">{footer}</span>}\n </div>\n </CraftCard>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyCM;AAvCN,gBAAmB;AAEnB,wBAA0B;AAc1B,MAAM,eAA+C;AAAA,EACnD,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,SAAS;AACX;AAEO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAuB;AACrB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,cAAG,aAAa,SAAS;AAAA,MACpC;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,qDAAC,SAAI,WAAU,qCACb;AAAA,sDAAC,OAAE,WAAU,0CAA0C,iBAAM;AAAA,UAC5D,QAAQ,4CAAC,SAAI,WAAU,iCAAiC,gBAAK;AAAA,WAChE;AAAA,QACA,4CAAC,OAAE,WAAU,0BAA0B,iBAAM;AAAA,QAC7C,6CAAC,SAAI,WAAU,6CACZ;AAAA,mBAAS,4CAAC,UAAK,WAAW,aAAa,KAAK,GAAI,iBAAM;AAAA,UACtD,UAAU,4CAAC,UAAK,WAAU,kCAAkC,kBAAO;AAAA,WACtE;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
|
+
|
|
5
|
+
type CraftStatTrend = "up" | "down" | "neutral";
|
|
6
|
+
type CraftStatCardProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
value: React.ReactNode;
|
|
9
|
+
delta?: React.ReactNode;
|
|
10
|
+
trend?: CraftStatTrend;
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
footer?: React.ReactNode;
|
|
13
|
+
tone?: ThemeName;
|
|
14
|
+
};
|
|
15
|
+
declare function CraftStatCard({ label, value, delta, trend, icon, footer, tone, className, ...props }: CraftStatCardProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { CraftStatCard, type CraftStatCardProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
4
|
+
|
|
5
|
+
type CraftStatTrend = "up" | "down" | "neutral";
|
|
6
|
+
type CraftStatCardProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
value: React.ReactNode;
|
|
9
|
+
delta?: React.ReactNode;
|
|
10
|
+
trend?: CraftStatTrend;
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
footer?: React.ReactNode;
|
|
13
|
+
tone?: ThemeName;
|
|
14
|
+
};
|
|
15
|
+
declare function CraftStatCard({ label, value, delta, trend, icon, footer, tone, className, ...props }: CraftStatCardProps): react_jsx_runtime.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { CraftStatCard, type CraftStatCardProps };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
import { CraftCard } from "../components/craft-card";
|
|
4
|
+
const trendClasses = {
|
|
5
|
+
up: "text-emerald-300",
|
|
6
|
+
down: "text-rose-300",
|
|
7
|
+
neutral: "text-[rgb(var(--nc-fg-muted))]"
|
|
8
|
+
};
|
|
9
|
+
function CraftStatCard({
|
|
10
|
+
label,
|
|
11
|
+
value,
|
|
12
|
+
delta,
|
|
13
|
+
trend = "neutral",
|
|
14
|
+
icon,
|
|
15
|
+
footer,
|
|
16
|
+
tone,
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ jsxs(
|
|
21
|
+
CraftCard,
|
|
22
|
+
{
|
|
23
|
+
className: cn("space-y-3", className),
|
|
24
|
+
tone,
|
|
25
|
+
...props,
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
28
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-[rgb(var(--nc-fg-muted))]", children: label }),
|
|
29
|
+
icon && /* @__PURE__ */ jsx("div", { className: "text-[rgb(var(--nc-fg-soft))]", children: icon })
|
|
30
|
+
] }),
|
|
31
|
+
/* @__PURE__ */ jsx("p", { className: "text-3xl font-semibold", children: value }),
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs", children: [
|
|
33
|
+
delta && /* @__PURE__ */ jsx("span", { className: trendClasses[trend], children: delta }),
|
|
34
|
+
footer && /* @__PURE__ */ jsx("span", { className: "text-[rgb(var(--nc-fg-muted))]", children: footer })
|
|
35
|
+
] })
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
CraftStatCard
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=craft-stat-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-stat-card.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\nimport { CraftCard } from \"@/components/craft-card\";\n\ntype CraftStatTrend = \"up\" | \"down\" | \"neutral\";\n\nexport type CraftStatCardProps = React.HTMLAttributes<HTMLDivElement> & {\n label: React.ReactNode;\n value: React.ReactNode;\n delta?: React.ReactNode;\n trend?: CraftStatTrend;\n icon?: React.ReactNode;\n footer?: React.ReactNode;\n tone?: ThemeName;\n};\n\nconst trendClasses: Record<CraftStatTrend, string> = {\n up: \"text-emerald-300\",\n down: \"text-rose-300\",\n neutral: \"text-[rgb(var(--nc-fg-muted))]\",\n};\n\nexport function CraftStatCard({\n label,\n value,\n delta,\n trend = \"neutral\",\n icon,\n footer,\n tone,\n className,\n ...props\n}: CraftStatCardProps) {\n return (\n <CraftCard\n className={cn(\"space-y-3\", className)}\n tone={tone}\n {...props}\n >\n <div className=\"flex items-center justify-between\">\n <p className=\"text-sm text-[rgb(var(--nc-fg-muted))]\">{label}</p>\n {icon && <div className=\"text-[rgb(var(--nc-fg-soft))]\">{icon}</div>}\n </div>\n <p className=\"text-3xl font-semibold\">{value}</p>\n <div className=\"flex items-center justify-between text-xs\">\n {delta && <span className={trendClasses[trend]}>{delta}</span>}\n {footer && <span className=\"text-[rgb(var(--nc-fg-muted))]\">{footer}</span>}\n </div>\n </CraftCard>\n );\n}\n"],"mappings":"AAyCM,SACE,KADF;AAvCN,SAAS,UAAU;AAEnB,SAAS,iBAAiB;AAc1B,MAAM,eAA+C;AAAA,EACnD,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,SAAS;AACX;AAEO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAuB;AACrB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,aAAa,SAAS;AAAA,MACpC;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,6BAAC,SAAI,WAAU,qCACb;AAAA,8BAAC,OAAE,WAAU,0CAA0C,iBAAM;AAAA,UAC5D,QAAQ,oBAAC,SAAI,WAAU,iCAAiC,gBAAK;AAAA,WAChE;AAAA,QACA,oBAAC,OAAE,WAAU,0BAA0B,iBAAM;AAAA,QAC7C,qBAAC,SAAI,WAAU,6CACZ;AAAA,mBAAS,oBAAC,UAAK,WAAW,aAAa,KAAK,GAAI,iBAAM;AAAA,UACtD,UAAU,oBAAC,UAAK,WAAU,kCAAkC,kBAAO;AAAA,WACtE;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var craft_submit_button_exports = {};
|
|
21
|
+
__export(craft_submit_button_exports, {
|
|
22
|
+
CraftSubmitButton: () => CraftSubmitButton
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(craft_submit_button_exports);
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_react_hook_form = require("react-hook-form");
|
|
27
|
+
var import_cn = require("../utils/cn");
|
|
28
|
+
function CraftSubmitButton({
|
|
29
|
+
className,
|
|
30
|
+
tone,
|
|
31
|
+
loading,
|
|
32
|
+
loadingLabel = "Submitting...",
|
|
33
|
+
disableWhenInvalid = true,
|
|
34
|
+
disabled,
|
|
35
|
+
children,
|
|
36
|
+
...props
|
|
37
|
+
}) {
|
|
38
|
+
var _a, _b, _c, _d;
|
|
39
|
+
const form = (0, import_react_hook_form.useFormContext)();
|
|
40
|
+
const isSubmitting = (_b = loading != null ? loading : (_a = form == null ? void 0 : form.formState) == null ? void 0 : _a.isSubmitting) != null ? _b : false;
|
|
41
|
+
const isValid = (_d = (_c = form == null ? void 0 : form.formState) == null ? void 0 : _c.isValid) != null ? _d : true;
|
|
42
|
+
const isDisabled = disabled || isSubmitting || disableWhenInvalid && !isValid;
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
44
|
+
"button",
|
|
45
|
+
{
|
|
46
|
+
type: "submit",
|
|
47
|
+
className: (0, import_cn.cn)(
|
|
48
|
+
"relative inline-flex items-center justify-center gap-2 rounded-xl px-6 py-2 text-sm font-semibold",
|
|
49
|
+
"bg-linear-to-br from-[rgb(var(--nc-accent-1))] via-[rgb(var(--nc-accent-2))] to-[rgb(var(--nc-accent-3))]",
|
|
50
|
+
"text-white shadow-[0_12px_30px_rgb(var(--nc-accent-1)/0.35)]",
|
|
51
|
+
"transition-all duration-200",
|
|
52
|
+
"hover:shadow-[0_16px_36px_rgb(var(--nc-accent-1)/0.5)] hover:scale-[1.02] active:scale-[0.98]",
|
|
53
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[rgb(var(--nc-accent-1)/0.6)]",
|
|
54
|
+
"disabled:opacity-60 disabled:cursor-not-allowed disabled:hover:scale-100",
|
|
55
|
+
className
|
|
56
|
+
),
|
|
57
|
+
"data-nc-theme": tone,
|
|
58
|
+
disabled: isDisabled,
|
|
59
|
+
...props,
|
|
60
|
+
children: [
|
|
61
|
+
isSubmitting && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "inline-flex h-4 w-4 animate-spin rounded-full border-2 border-white/60 border-t-white" }),
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: isSubmitting ? loadingLabel : children })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
+
0 && (module.exports = {
|
|
69
|
+
CraftSubmitButton
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=craft-submit-button.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-submit-button.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useFormContext } from \"react-hook-form\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\n\nexport type CraftSubmitButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n tone?: ThemeName;\n loading?: boolean;\n loadingLabel?: React.ReactNode;\n disableWhenInvalid?: boolean;\n};\n\nexport function CraftSubmitButton({\n className,\n tone,\n loading,\n loadingLabel = \"Submitting...\",\n disableWhenInvalid = true,\n disabled,\n children,\n ...props\n}: CraftSubmitButtonProps) {\n const form = useFormContext();\n const isSubmitting = loading ?? form?.formState?.isSubmitting ?? false;\n const isValid = form?.formState?.isValid ?? true;\n const isDisabled =\n disabled || isSubmitting || (disableWhenInvalid && !isValid);\n\n return (\n <button\n type=\"submit\"\n className={cn(\n \"relative inline-flex items-center justify-center gap-2 rounded-xl px-6 py-2 text-sm font-semibold\",\n \"bg-linear-to-br from-[rgb(var(--nc-accent-1))] via-[rgb(var(--nc-accent-2))] to-[rgb(var(--nc-accent-3))]\",\n \"text-white shadow-[0_12px_30px_rgb(var(--nc-accent-1)/0.35)]\",\n \"transition-all duration-200\",\n \"hover:shadow-[0_16px_36px_rgb(var(--nc-accent-1)/0.5)] hover:scale-[1.02] active:scale-[0.98]\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[rgb(var(--nc-accent-1)/0.6)]\",\n \"disabled:opacity-60 disabled:cursor-not-allowed disabled:hover:scale-100\",\n className\n )}\n data-nc-theme={tone}\n disabled={isDisabled}\n {...props}\n >\n {isSubmitting && (\n <span className=\"inline-flex h-4 w-4 animate-spin rounded-full border-2 border-white/60 border-t-white\" />\n )}\n <span>{isSubmitting ? loadingLabel : children}</span>\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCI;AA7BJ,6BAA+B;AAE/B,gBAAmB;AAUZ,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA2B;AAxB3B;AAyBE,QAAM,WAAO,uCAAe;AAC5B,QAAM,gBAAe,kCAAW,kCAAM,cAAN,mBAAiB,iBAA5B,YAA4C;AACjE,QAAM,WAAU,wCAAM,cAAN,mBAAiB,YAAjB,YAA4B;AAC5C,QAAM,aACJ,YAAY,gBAAiB,sBAAsB,CAAC;AAEtD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,iBAAe;AAAA,MACf,UAAU;AAAA,MACT,GAAG;AAAA,MAEH;AAAA,wBACC,4CAAC,UAAK,WAAU,yFAAwF;AAAA,QAE1G,4CAAC,UAAM,yBAAe,eAAe,UAAS;AAAA;AAAA;AAAA,EAChD;AAEJ;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
|
+
|
|
5
|
+
type CraftSubmitButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
6
|
+
tone?: ThemeName;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
loadingLabel?: React.ReactNode;
|
|
9
|
+
disableWhenInvalid?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare function CraftSubmitButton({ className, tone, loading, loadingLabel, disableWhenInvalid, disabled, children, ...props }: CraftSubmitButtonProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { CraftSubmitButton, type CraftSubmitButtonProps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
4
|
+
|
|
5
|
+
type CraftSubmitButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
6
|
+
tone?: ThemeName;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
loadingLabel?: React.ReactNode;
|
|
9
|
+
disableWhenInvalid?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare function CraftSubmitButton({ className, tone, loading, loadingLabel, disableWhenInvalid, disabled, children, ...props }: CraftSubmitButtonProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { CraftSubmitButton, type CraftSubmitButtonProps };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useFormContext } from "react-hook-form";
|
|
4
|
+
import { cn } from "../utils/cn";
|
|
5
|
+
function CraftSubmitButton({
|
|
6
|
+
className,
|
|
7
|
+
tone,
|
|
8
|
+
loading,
|
|
9
|
+
loadingLabel = "Submitting...",
|
|
10
|
+
disableWhenInvalid = true,
|
|
11
|
+
disabled,
|
|
12
|
+
children,
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
var _a, _b, _c, _d;
|
|
16
|
+
const form = useFormContext();
|
|
17
|
+
const isSubmitting = (_b = loading != null ? loading : (_a = form == null ? void 0 : form.formState) == null ? void 0 : _a.isSubmitting) != null ? _b : false;
|
|
18
|
+
const isValid = (_d = (_c = form == null ? void 0 : form.formState) == null ? void 0 : _c.isValid) != null ? _d : true;
|
|
19
|
+
const isDisabled = disabled || isSubmitting || disableWhenInvalid && !isValid;
|
|
20
|
+
return /* @__PURE__ */ jsxs(
|
|
21
|
+
"button",
|
|
22
|
+
{
|
|
23
|
+
type: "submit",
|
|
24
|
+
className: cn(
|
|
25
|
+
"relative inline-flex items-center justify-center gap-2 rounded-xl px-6 py-2 text-sm font-semibold",
|
|
26
|
+
"bg-linear-to-br from-[rgb(var(--nc-accent-1))] via-[rgb(var(--nc-accent-2))] to-[rgb(var(--nc-accent-3))]",
|
|
27
|
+
"text-white shadow-[0_12px_30px_rgb(var(--nc-accent-1)/0.35)]",
|
|
28
|
+
"transition-all duration-200",
|
|
29
|
+
"hover:shadow-[0_16px_36px_rgb(var(--nc-accent-1)/0.5)] hover:scale-[1.02] active:scale-[0.98]",
|
|
30
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[rgb(var(--nc-accent-1)/0.6)]",
|
|
31
|
+
"disabled:opacity-60 disabled:cursor-not-allowed disabled:hover:scale-100",
|
|
32
|
+
className
|
|
33
|
+
),
|
|
34
|
+
"data-nc-theme": tone,
|
|
35
|
+
disabled: isDisabled,
|
|
36
|
+
...props,
|
|
37
|
+
children: [
|
|
38
|
+
isSubmitting && /* @__PURE__ */ jsx("span", { className: "inline-flex h-4 w-4 animate-spin rounded-full border-2 border-white/60 border-t-white" }),
|
|
39
|
+
/* @__PURE__ */ jsx("span", { children: isSubmitting ? loadingLabel : children })
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
CraftSubmitButton
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=craft-submit-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-submit-button.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { useFormContext } from \"react-hook-form\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\n\nexport type CraftSubmitButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {\n tone?: ThemeName;\n loading?: boolean;\n loadingLabel?: React.ReactNode;\n disableWhenInvalid?: boolean;\n};\n\nexport function CraftSubmitButton({\n className,\n tone,\n loading,\n loadingLabel = \"Submitting...\",\n disableWhenInvalid = true,\n disabled,\n children,\n ...props\n}: CraftSubmitButtonProps) {\n const form = useFormContext();\n const isSubmitting = loading ?? form?.formState?.isSubmitting ?? false;\n const isValid = form?.formState?.isValid ?? true;\n const isDisabled =\n disabled || isSubmitting || (disableWhenInvalid && !isValid);\n\n return (\n <button\n type=\"submit\"\n className={cn(\n \"relative inline-flex items-center justify-center gap-2 rounded-xl px-6 py-2 text-sm font-semibold\",\n \"bg-linear-to-br from-[rgb(var(--nc-accent-1))] via-[rgb(var(--nc-accent-2))] to-[rgb(var(--nc-accent-3))]\",\n \"text-white shadow-[0_12px_30px_rgb(var(--nc-accent-1)/0.35)]\",\n \"transition-all duration-200\",\n \"hover:shadow-[0_16px_36px_rgb(var(--nc-accent-1)/0.5)] hover:scale-[1.02] active:scale-[0.98]\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[rgb(var(--nc-accent-1)/0.6)]\",\n \"disabled:opacity-60 disabled:cursor-not-allowed disabled:hover:scale-100\",\n className\n )}\n data-nc-theme={tone}\n disabled={isDisabled}\n {...props}\n >\n {isSubmitting && (\n <span className=\"inline-flex h-4 w-4 animate-spin rounded-full border-2 border-white/60 border-t-white\" />\n )}\n <span>{isSubmitting ? loadingLabel : children}</span>\n </button>\n );\n}\n"],"mappings":";AAgCI,SAiBI,KAjBJ;AA7BJ,SAAS,sBAAsB;AAE/B,SAAS,UAAU;AAUZ,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA2B;AAxB3B;AAyBE,QAAM,OAAO,eAAe;AAC5B,QAAM,gBAAe,kCAAW,kCAAM,cAAN,mBAAiB,iBAA5B,YAA4C;AACjE,QAAM,WAAU,wCAAM,cAAN,mBAAiB,YAAjB,YAA4B;AAC5C,QAAM,aACJ,YAAY,gBAAiB,sBAAsB,CAAC;AAEtD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,iBAAe;AAAA,MACf,UAAU;AAAA,MACT,GAAG;AAAA,MAEH;AAAA,wBACC,oBAAC,UAAK,WAAU,yFAAwF;AAAA,QAE1G,oBAAC,UAAM,yBAAe,eAAe,UAAS;AAAA;AAAA;AAAA,EAChD;AAEJ;","names":[]}
|