@jameskabz/nextcraft-ui 0.6.4 → 0.6.5
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/forms/types.cjs +17 -0
- package/dist/components/forms/types.cjs.map +1 -0
- package/dist/components/forms/types.d.cts +7 -0
- package/dist/components/forms/types.d.ts +7 -0
- package/dist/components/forms/types.js +1 -0
- package/dist/components/forms/types.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/layout/types.cjs +29 -0
- package/dist/components/layout/types.cjs.map +1 -0
- package/dist/components/layout/types.d.cts +12 -0
- package/dist/components/layout/types.d.ts +12 -0
- package/dist/components/layout/types.js +5 -0
- package/dist/components/layout/types.js.map +1 -0
- package/dist/components/table/types.cjs +17 -0
- package/dist/components/table/types.cjs.map +1 -0
- package/dist/components/table/types.d.cts +7 -0
- package/dist/components/table/types.d.ts +7 -0
- package/dist/components/table/types.js +1 -0
- package/dist/components/table/types.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/craft/components.d.cts +36 -369
- package/dist/craft/components.d.ts +36 -369
- package/dist/craft/forms.d.cts +7 -101
- package/dist/craft/forms.d.ts +7 -101
- package/dist/craft/layout.d.cts +12 -170
- package/dist/craft/layout.d.ts +12 -170
- package/dist/craft/table.d.cts +7 -99
- package/dist/craft/table.d.ts +7 -99
- package/dist/craft/theme.d.cts +3 -9
- package/dist/craft/theme.d.ts +3 -9
- package/dist/index.d.cts +50 -6
- package/dist/index.d.ts +50 -6
- package/dist/styles.css +31 -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 +1 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var craft_icon_exports = {};
|
|
31
|
+
__export(craft_icon_exports, {
|
|
32
|
+
CraftIcon: () => CraftIcon,
|
|
33
|
+
CraftIconProvider: () => CraftIconProvider
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(craft_icon_exports);
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var React = __toESM(require("react"), 1);
|
|
38
|
+
var import_cn = require("@/utils/cn");
|
|
39
|
+
const CraftIconContext = React.createContext(null);
|
|
40
|
+
function CraftIconProvider({ icons, children }) {
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CraftIconContext.Provider, { value: icons, children });
|
|
42
|
+
}
|
|
43
|
+
function CraftIcon({
|
|
44
|
+
name,
|
|
45
|
+
className,
|
|
46
|
+
"aria-label": ariaLabel,
|
|
47
|
+
icons,
|
|
48
|
+
useLucide = true
|
|
49
|
+
}) {
|
|
50
|
+
const contextRegistry = React.useContext(CraftIconContext);
|
|
51
|
+
const registry = icons != null ? icons : contextRegistry;
|
|
52
|
+
const icon = registry == null ? void 0 : registry[name];
|
|
53
|
+
const [LucideIcon, setLucideIcon] = React.useState(
|
|
54
|
+
null
|
|
55
|
+
);
|
|
56
|
+
React.useEffect(() => {
|
|
57
|
+
if (!useLucide || icon || LucideIcon) return;
|
|
58
|
+
let mounted = true;
|
|
59
|
+
(async () => {
|
|
60
|
+
try {
|
|
61
|
+
const mod = await Function(
|
|
62
|
+
"return import('lucide-react/dynamic')"
|
|
63
|
+
)();
|
|
64
|
+
if (mounted) {
|
|
65
|
+
setLucideIcon(() => mod.DynamicIcon);
|
|
66
|
+
}
|
|
67
|
+
} catch {
|
|
68
|
+
if (mounted) setLucideIcon(null);
|
|
69
|
+
}
|
|
70
|
+
})();
|
|
71
|
+
return () => {
|
|
72
|
+
mounted = false;
|
|
73
|
+
};
|
|
74
|
+
}, [LucideIcon, icon, useLucide]);
|
|
75
|
+
if (!icon) {
|
|
76
|
+
if (!useLucide) return null;
|
|
77
|
+
if (!LucideIcon) return null;
|
|
78
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
|
+
LucideIcon,
|
|
80
|
+
{
|
|
81
|
+
name,
|
|
82
|
+
className,
|
|
83
|
+
"aria-hidden": ariaLabel ? void 0 : true,
|
|
84
|
+
"aria-label": ariaLabel
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
if (React.isValidElement(icon)) {
|
|
89
|
+
return React.cloneElement(icon, {
|
|
90
|
+
className: (0, import_cn.cn)(icon.props.className, className),
|
|
91
|
+
"aria-hidden": ariaLabel ? void 0 : true,
|
|
92
|
+
"aria-label": ariaLabel
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className, "aria-label": ariaLabel, children: icon });
|
|
96
|
+
}
|
|
97
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
+
0 && (module.exports = {
|
|
99
|
+
CraftIcon,
|
|
100
|
+
CraftIconProvider
|
|
101
|
+
});
|
|
102
|
+
//# sourceMappingURL=craft-icon.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-icon.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\nexport type CraftIconRegistry = Record<string, React.ReactNode>;\n\nconst CraftIconContext = React.createContext<CraftIconRegistry | null>(null);\n\nexport type CraftIconProviderProps = {\n icons: CraftIconRegistry;\n children: React.ReactNode;\n};\n\nexport function CraftIconProvider({ icons, children }: CraftIconProviderProps) {\n return <CraftIconContext.Provider value={icons}>{children}</CraftIconContext.Provider>;\n}\n\nexport type CraftIconProps = {\n name: string;\n className?: string;\n \"aria-label\"?: string;\n icons?: CraftIconRegistry;\n useLucide?: boolean;\n};\n\ntype DynamicIconComponent = React.ComponentType<{\n name: string;\n className?: string;\n \"aria-hidden\"?: boolean;\n \"aria-label\"?: string;\n}>;\n\nexport function CraftIcon({\n name,\n className,\n \"aria-label\": ariaLabel,\n icons,\n useLucide = true,\n}: CraftIconProps) {\n const contextRegistry = React.useContext(CraftIconContext);\n const registry = icons ?? contextRegistry;\n const icon = registry?.[name];\n const [LucideIcon, setLucideIcon] = React.useState<DynamicIconComponent | null>(\n null\n );\n\n React.useEffect(() => {\n if (!useLucide || icon || LucideIcon) return;\n let mounted = true;\n (async () => {\n try {\n const mod = await (Function)(\n \"return import('lucide-react/dynamic')\"\n )();\n if (mounted) {\n setLucideIcon(() => mod.DynamicIcon as DynamicIconComponent);\n }\n } catch {\n if (mounted) setLucideIcon(null);\n }\n })();\n return () => {\n mounted = false;\n };\n }, [LucideIcon, icon, useLucide]);\n\n if (!icon) {\n if (!useLucide) return null;\n if (!LucideIcon) return null;\n return (\n <LucideIcon\n name={name}\n className={className}\n aria-hidden={ariaLabel ? undefined : true}\n aria-label={ariaLabel}\n />\n );\n }\n\n type IconElementProps = {\n className?: string;\n \"aria-hidden\"?: boolean;\n \"aria-label\"?: string;\n };\n\n if (React.isValidElement<IconElementProps>(icon)) {\n return React.cloneElement(icon, {\n className: cn(icon.props.className, className),\n \"aria-hidden\": ariaLabel ? undefined : true,\n \"aria-label\": ariaLabel,\n });\n }\n\n return (\n <span className={className} aria-label={ariaLabel}>\n {icon}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBS;AAdT,YAAuB;AAEvB,gBAAmB;AAInB,MAAM,mBAAmB,MAAM,cAAwC,IAAI;AAOpE,SAAS,kBAAkB,EAAE,OAAO,SAAS,GAA2B;AAC7E,SAAO,4CAAC,iBAAiB,UAAjB,EAA0B,OAAO,OAAQ,UAAS;AAC5D;AAiBO,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA,YAAY;AACd,GAAmB;AACjB,QAAM,kBAAkB,MAAM,WAAW,gBAAgB;AACzD,QAAM,WAAW,wBAAS;AAC1B,QAAM,OAAO,qCAAW;AACxB,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM;AAAA,IACxC;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,CAAC,aAAa,QAAQ,WAAY;AACtC,QAAI,UAAU;AACd,KAAC,YAAY;AACX,UAAI;AACF,cAAM,MAAM,MAAO;AAAA,UACjB;AAAA,QACF,EAAE;AACF,YAAI,SAAS;AACX,wBAAc,MAAM,IAAI,WAAmC;AAAA,QAC7D;AAAA,MACF,QAAQ;AACN,YAAI,QAAS,eAAc,IAAI;AAAA,MACjC;AAAA,IACF,GAAG;AACH,WAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,EACF,GAAG,CAAC,YAAY,MAAM,SAAS,CAAC;AAEhC,MAAI,CAAC,MAAM;AACT,QAAI,CAAC,UAAW,QAAO;AACvB,QAAI,CAAC,WAAY,QAAO;AACxB,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,eAAa,YAAY,SAAY;AAAA,QACrC,cAAY;AAAA;AAAA,IACd;AAAA,EAEJ;AAQA,MAAI,MAAM,eAAiC,IAAI,GAAG;AAChD,WAAO,MAAM,aAAa,MAAM;AAAA,MAC9B,eAAW,cAAG,KAAK,MAAM,WAAW,SAAS;AAAA,MAC7C,eAAe,YAAY,SAAY;AAAA,MACvC,cAAc;AAAA,IAChB,CAAC;AAAA,EACH;AAEA,SACE,4CAAC,UAAK,WAAsB,cAAY,WACrC,gBACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type CraftIconRegistry = Record<string, React.ReactNode>;
|
|
5
|
+
type CraftIconProviderProps = {
|
|
6
|
+
icons: CraftIconRegistry;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
declare function CraftIconProvider({ icons, children }: CraftIconProviderProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
type CraftIconProps = {
|
|
11
|
+
name: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
"aria-label"?: string;
|
|
14
|
+
icons?: CraftIconRegistry;
|
|
15
|
+
useLucide?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare function CraftIcon({ name, className, "aria-label": ariaLabel, icons, useLucide, }: CraftIconProps): react_jsx_runtime.JSX.Element | null;
|
|
18
|
+
|
|
19
|
+
export { CraftIcon, type CraftIconProps, CraftIconProvider, type CraftIconProviderProps, type CraftIconRegistry };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
type CraftIconRegistry = Record<string, React.ReactNode>;
|
|
5
|
+
type CraftIconProviderProps = {
|
|
6
|
+
icons: CraftIconRegistry;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
declare function CraftIconProvider({ icons, children }: CraftIconProviderProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
type CraftIconProps = {
|
|
11
|
+
name: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
"aria-label"?: string;
|
|
14
|
+
icons?: CraftIconRegistry;
|
|
15
|
+
useLucide?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare function CraftIcon({ name, className, "aria-label": ariaLabel, icons, useLucide, }: CraftIconProps): react_jsx_runtime.JSX.Element | null;
|
|
18
|
+
|
|
19
|
+
export { CraftIcon, type CraftIconProps, CraftIconProvider, type CraftIconProviderProps, type CraftIconRegistry };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "@/utils/cn";
|
|
5
|
+
const CraftIconContext = React.createContext(null);
|
|
6
|
+
function CraftIconProvider({ icons, children }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(CraftIconContext.Provider, { value: icons, children });
|
|
8
|
+
}
|
|
9
|
+
function CraftIcon({
|
|
10
|
+
name,
|
|
11
|
+
className,
|
|
12
|
+
"aria-label": ariaLabel,
|
|
13
|
+
icons,
|
|
14
|
+
useLucide = true
|
|
15
|
+
}) {
|
|
16
|
+
const contextRegistry = React.useContext(CraftIconContext);
|
|
17
|
+
const registry = icons != null ? icons : contextRegistry;
|
|
18
|
+
const icon = registry == null ? void 0 : registry[name];
|
|
19
|
+
const [LucideIcon, setLucideIcon] = React.useState(
|
|
20
|
+
null
|
|
21
|
+
);
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
if (!useLucide || icon || LucideIcon) return;
|
|
24
|
+
let mounted = true;
|
|
25
|
+
(async () => {
|
|
26
|
+
try {
|
|
27
|
+
const mod = await Function(
|
|
28
|
+
"return import('lucide-react/dynamic')"
|
|
29
|
+
)();
|
|
30
|
+
if (mounted) {
|
|
31
|
+
setLucideIcon(() => mod.DynamicIcon);
|
|
32
|
+
}
|
|
33
|
+
} catch {
|
|
34
|
+
if (mounted) setLucideIcon(null);
|
|
35
|
+
}
|
|
36
|
+
})();
|
|
37
|
+
return () => {
|
|
38
|
+
mounted = false;
|
|
39
|
+
};
|
|
40
|
+
}, [LucideIcon, icon, useLucide]);
|
|
41
|
+
if (!icon) {
|
|
42
|
+
if (!useLucide) return null;
|
|
43
|
+
if (!LucideIcon) return null;
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
LucideIcon,
|
|
46
|
+
{
|
|
47
|
+
name,
|
|
48
|
+
className,
|
|
49
|
+
"aria-hidden": ariaLabel ? void 0 : true,
|
|
50
|
+
"aria-label": ariaLabel
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
if (React.isValidElement(icon)) {
|
|
55
|
+
return React.cloneElement(icon, {
|
|
56
|
+
className: cn(icon.props.className, className),
|
|
57
|
+
"aria-hidden": ariaLabel ? void 0 : true,
|
|
58
|
+
"aria-label": ariaLabel
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return /* @__PURE__ */ jsx("span", { className, "aria-label": ariaLabel, children: icon });
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
CraftIcon,
|
|
65
|
+
CraftIconProvider
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=craft-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-icon.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\nexport type CraftIconRegistry = Record<string, React.ReactNode>;\n\nconst CraftIconContext = React.createContext<CraftIconRegistry | null>(null);\n\nexport type CraftIconProviderProps = {\n icons: CraftIconRegistry;\n children: React.ReactNode;\n};\n\nexport function CraftIconProvider({ icons, children }: CraftIconProviderProps) {\n return <CraftIconContext.Provider value={icons}>{children}</CraftIconContext.Provider>;\n}\n\nexport type CraftIconProps = {\n name: string;\n className?: string;\n \"aria-label\"?: string;\n icons?: CraftIconRegistry;\n useLucide?: boolean;\n};\n\ntype DynamicIconComponent = React.ComponentType<{\n name: string;\n className?: string;\n \"aria-hidden\"?: boolean;\n \"aria-label\"?: string;\n}>;\n\nexport function CraftIcon({\n name,\n className,\n \"aria-label\": ariaLabel,\n icons,\n useLucide = true,\n}: CraftIconProps) {\n const contextRegistry = React.useContext(CraftIconContext);\n const registry = icons ?? contextRegistry;\n const icon = registry?.[name];\n const [LucideIcon, setLucideIcon] = React.useState<DynamicIconComponent | null>(\n null\n );\n\n React.useEffect(() => {\n if (!useLucide || icon || LucideIcon) return;\n let mounted = true;\n (async () => {\n try {\n const mod = await (Function)(\n \"return import('lucide-react/dynamic')\"\n )();\n if (mounted) {\n setLucideIcon(() => mod.DynamicIcon as DynamicIconComponent);\n }\n } catch {\n if (mounted) setLucideIcon(null);\n }\n })();\n return () => {\n mounted = false;\n };\n }, [LucideIcon, icon, useLucide]);\n\n if (!icon) {\n if (!useLucide) return null;\n if (!LucideIcon) return null;\n return (\n <LucideIcon\n name={name}\n className={className}\n aria-hidden={ariaLabel ? undefined : true}\n aria-label={ariaLabel}\n />\n );\n }\n\n type IconElementProps = {\n className?: string;\n \"aria-hidden\"?: boolean;\n \"aria-label\"?: string;\n };\n\n if (React.isValidElement<IconElementProps>(icon)) {\n return React.cloneElement(icon, {\n className: cn(icon.props.className, className),\n \"aria-hidden\": ariaLabel ? undefined : true,\n \"aria-label\": ariaLabel,\n });\n }\n\n return (\n <span className={className} aria-label={ariaLabel}>\n {icon}\n </span>\n );\n}\n"],"mappings":";AAgBS;AAdT,YAAY,WAAW;AAEvB,SAAS,UAAU;AAInB,MAAM,mBAAmB,MAAM,cAAwC,IAAI;AAOpE,SAAS,kBAAkB,EAAE,OAAO,SAAS,GAA2B;AAC7E,SAAO,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,OAAQ,UAAS;AAC5D;AAiBO,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA,YAAY;AACd,GAAmB;AACjB,QAAM,kBAAkB,MAAM,WAAW,gBAAgB;AACzD,QAAM,WAAW,wBAAS;AAC1B,QAAM,OAAO,qCAAW;AACxB,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM;AAAA,IACxC;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,CAAC,aAAa,QAAQ,WAAY;AACtC,QAAI,UAAU;AACd,KAAC,YAAY;AACX,UAAI;AACF,cAAM,MAAM,MAAO;AAAA,UACjB;AAAA,QACF,EAAE;AACF,YAAI,SAAS;AACX,wBAAc,MAAM,IAAI,WAAmC;AAAA,QAC7D;AAAA,MACF,QAAQ;AACN,YAAI,QAAS,eAAc,IAAI;AAAA,MACjC;AAAA,IACF,GAAG;AACH,WAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,EACF,GAAG,CAAC,YAAY,MAAM,SAAS,CAAC;AAEhC,MAAI,CAAC,MAAM;AACT,QAAI,CAAC,UAAW,QAAO;AACvB,QAAI,CAAC,WAAY,QAAO;AACxB,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,eAAa,YAAY,SAAY;AAAA,QACrC,cAAY;AAAA;AAAA,IACd;AAAA,EAEJ;AAQA,MAAI,MAAM,eAAiC,IAAI,GAAG;AAChD,WAAO,MAAM,aAAa,MAAM;AAAA,MAC9B,WAAW,GAAG,KAAK,MAAM,WAAW,SAAS;AAAA,MAC7C,eAAe,YAAY,SAAY;AAAA,MACvC,cAAc;AAAA,IAChB,CAAC;AAAA,EACH;AAEA,SACE,oBAAC,UAAK,WAAsB,cAAY,WACrC,gBACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
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_input_exports = {};
|
|
30
|
+
__export(craft_input_exports, {
|
|
31
|
+
CraftInput: () => CraftInput
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(craft_input_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 inputSizeClasses = {
|
|
38
|
+
sm: "h-10 px-4 text-sm",
|
|
39
|
+
md: "h-12 px-5 text-base",
|
|
40
|
+
lg: "h-14 px-6 text-lg"
|
|
41
|
+
};
|
|
42
|
+
const CraftInput = React.forwardRef(
|
|
43
|
+
({ className, tone, inputSize = "md", glow = true, icon, ...props }, ref) => {
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative w-full", "data-nc-theme": tone, children: [
|
|
45
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute left-4 top-1/2 -translate-y-1/2 text-[rgb(var(--nc-fg-soft))]", children: icon }),
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
47
|
+
"input",
|
|
48
|
+
{
|
|
49
|
+
ref,
|
|
50
|
+
className: (0, import_cn.cn)(
|
|
51
|
+
"w-full rounded-2xl border-2 bg-[rgb(var(--nc-surface)/0.08)] text-[rgb(var(--nc-fg))] backdrop-blur-xl",
|
|
52
|
+
"shadow-[inset_0_2px_8px_rgba(0,0,0,0.3)]",
|
|
53
|
+
"focus:outline-none focus:ring-4",
|
|
54
|
+
"transition-all duration-300",
|
|
55
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
56
|
+
inputSizeClasses[inputSize],
|
|
57
|
+
"border-[rgb(var(--nc-border)/0.35)]",
|
|
58
|
+
"focus:border-[rgb(var(--nc-accent-1)/0.8)] focus:ring-[rgb(var(--nc-accent-1)/0.3)]",
|
|
59
|
+
"placeholder:text-[rgb(var(--nc-fg-soft))]",
|
|
60
|
+
glow ? "focus:shadow-[0_0_30px_-5px_var(--glow-color)]" : "",
|
|
61
|
+
icon ? "pl-12" : "",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
style: {
|
|
65
|
+
"--glow-color": "rgb(var(--nc-accent-1) / 0.5)"
|
|
66
|
+
},
|
|
67
|
+
...props
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
] });
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
CraftInput.displayName = "CraftInput";
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
CraftInput
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=craft-input.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-input.tsx"],"sourcesContent":["\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\n\n// ============================================================================\n// CRAFT INPUT\n// ============================================================================\n\ntype CraftInputSize = \"sm\" | \"md\" | \"lg\";\n\nexport type CraftInputProps = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n \"size\"\n> & {\n tone?: ThemeName;\n inputSize?: CraftInputSize;\n glow?: boolean;\n icon?: React.ReactNode;\n};\n\nconst inputSizeClasses: Record<CraftInputSize, string> = {\n sm: \"h-10 px-4 text-sm\",\n md: \"h-12 px-5 text-base\",\n lg: \"h-14 px-6 text-lg\",\n};\n\nexport const CraftInput = React.forwardRef<HTMLInputElement, CraftInputProps>(\n (\n { className, tone, inputSize = \"md\", glow = true, icon, ...props },\n ref\n ) => {\n return (\n <div className=\"relative w-full\" data-nc-theme={tone}>\n {icon && (\n <div className=\"absolute left-4 top-1/2 -translate-y-1/2 text-[rgb(var(--nc-fg-soft))]\">\n {icon}\n </div>\n )}\n <input\n ref={ref}\n className={cn(\n \"w-full 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 inputSizeClasses[inputSize],\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 \"placeholder:text-[rgb(var(--nc-fg-soft))]\",\n glow ? \"focus:shadow-[0_0_30px_-5px_var(--glow-color)]\" : \"\",\n icon ? \"pl-12\" : \"\",\n className\n )}\n style={{\n \"--glow-color\": \"rgb(var(--nc-accent-1) / 0.5)\",\n } as React.CSSProperties}\n {...props}\n />\n </div>\n );\n }\n);\n\nCraftInput.displayName = \"CraftInput\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkCM;AAjCN,YAAuB;AAEvB,gBAAmB;AAmBnB,MAAM,mBAAmD;AAAA,EACvD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEO,MAAM,aAAa,MAAM;AAAA,EAC9B,CACE,EAAE,WAAW,MAAM,YAAY,MAAM,OAAO,MAAM,MAAM,GAAG,MAAM,GACjE,QACG;AACH,WACE,6CAAC,SAAI,WAAU,mBAAkB,iBAAe,MAC7C;AAAA,cACC,4CAAC,SAAI,WAAU,0EACZ,gBACH;AAAA,MAEF;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,eAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,iBAAiB,SAAS;AAAA,YAC1B;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO,mDAAmD;AAAA,YAC1D,OAAO,UAAU;AAAA,YACjB;AAAA,UACF;AAAA,UACA,OAAO;AAAA,YACL,gBAAgB;AAAA,UAClB;AAAA,UACC,GAAG;AAAA;AAAA,MACN;AAAA,OACF;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { a as ThemeName } from '../theme-context-EVI9PfKv.cjs';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
type CraftInputSize = "sm" | "md" | "lg";
|
|
6
|
+
type CraftInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
7
|
+
tone?: ThemeName;
|
|
8
|
+
inputSize?: CraftInputSize;
|
|
9
|
+
glow?: boolean;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
declare const CraftInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
13
|
+
tone?: ThemeName;
|
|
14
|
+
inputSize?: CraftInputSize;
|
|
15
|
+
glow?: boolean;
|
|
16
|
+
icon?: React.ReactNode;
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
18
|
+
|
|
19
|
+
export { CraftInput, type CraftInputProps };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { a as ThemeName } from '../theme-context-EVI9PfKv.js';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
type CraftInputSize = "sm" | "md" | "lg";
|
|
6
|
+
type CraftInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
7
|
+
tone?: ThemeName;
|
|
8
|
+
inputSize?: CraftInputSize;
|
|
9
|
+
glow?: boolean;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
declare const CraftInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & {
|
|
13
|
+
tone?: ThemeName;
|
|
14
|
+
inputSize?: CraftInputSize;
|
|
15
|
+
glow?: boolean;
|
|
16
|
+
icon?: React.ReactNode;
|
|
17
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
18
|
+
|
|
19
|
+
export { CraftInput, type CraftInputProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "@/utils/cn";
|
|
4
|
+
const inputSizeClasses = {
|
|
5
|
+
sm: "h-10 px-4 text-sm",
|
|
6
|
+
md: "h-12 px-5 text-base",
|
|
7
|
+
lg: "h-14 px-6 text-lg"
|
|
8
|
+
};
|
|
9
|
+
const CraftInput = React.forwardRef(
|
|
10
|
+
({ className, tone, inputSize = "md", glow = true, icon, ...props }, ref) => {
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", "data-nc-theme": tone, children: [
|
|
12
|
+
icon && /* @__PURE__ */ jsx("div", { className: "absolute left-4 top-1/2 -translate-y-1/2 text-[rgb(var(--nc-fg-soft))]", children: icon }),
|
|
13
|
+
/* @__PURE__ */ jsx(
|
|
14
|
+
"input",
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
className: cn(
|
|
18
|
+
"w-full rounded-2xl border-2 bg-[rgb(var(--nc-surface)/0.08)] text-[rgb(var(--nc-fg))] backdrop-blur-xl",
|
|
19
|
+
"shadow-[inset_0_2px_8px_rgba(0,0,0,0.3)]",
|
|
20
|
+
"focus:outline-none focus:ring-4",
|
|
21
|
+
"transition-all duration-300",
|
|
22
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
23
|
+
inputSizeClasses[inputSize],
|
|
24
|
+
"border-[rgb(var(--nc-border)/0.35)]",
|
|
25
|
+
"focus:border-[rgb(var(--nc-accent-1)/0.8)] focus:ring-[rgb(var(--nc-accent-1)/0.3)]",
|
|
26
|
+
"placeholder:text-[rgb(var(--nc-fg-soft))]",
|
|
27
|
+
glow ? "focus:shadow-[0_0_30px_-5px_var(--glow-color)]" : "",
|
|
28
|
+
icon ? "pl-12" : "",
|
|
29
|
+
className
|
|
30
|
+
),
|
|
31
|
+
style: {
|
|
32
|
+
"--glow-color": "rgb(var(--nc-accent-1) / 0.5)"
|
|
33
|
+
},
|
|
34
|
+
...props
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
] });
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
CraftInput.displayName = "CraftInput";
|
|
41
|
+
export {
|
|
42
|
+
CraftInput
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=craft-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-input.tsx"],"sourcesContent":["\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\n\n// ============================================================================\n// CRAFT INPUT\n// ============================================================================\n\ntype CraftInputSize = \"sm\" | \"md\" | \"lg\";\n\nexport type CraftInputProps = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n \"size\"\n> & {\n tone?: ThemeName;\n inputSize?: CraftInputSize;\n glow?: boolean;\n icon?: React.ReactNode;\n};\n\nconst inputSizeClasses: Record<CraftInputSize, string> = {\n sm: \"h-10 px-4 text-sm\",\n md: \"h-12 px-5 text-base\",\n lg: \"h-14 px-6 text-lg\",\n};\n\nexport const CraftInput = React.forwardRef<HTMLInputElement, CraftInputProps>(\n (\n { className, tone, inputSize = \"md\", glow = true, icon, ...props },\n ref\n ) => {\n return (\n <div className=\"relative w-full\" data-nc-theme={tone}>\n {icon && (\n <div className=\"absolute left-4 top-1/2 -translate-y-1/2 text-[rgb(var(--nc-fg-soft))]\">\n {icon}\n </div>\n )}\n <input\n ref={ref}\n className={cn(\n \"w-full 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 inputSizeClasses[inputSize],\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 \"placeholder:text-[rgb(var(--nc-fg-soft))]\",\n glow ? \"focus:shadow-[0_0_30px_-5px_var(--glow-color)]\" : \"\",\n icon ? \"pl-12\" : \"\",\n className\n )}\n style={{\n \"--glow-color\": \"rgb(var(--nc-accent-1) / 0.5)\",\n } as React.CSSProperties}\n {...props}\n />\n </div>\n );\n }\n);\n\nCraftInput.displayName = \"CraftInput\";\n"],"mappings":"AAkCM,SAEI,KAFJ;AAjCN,YAAY,WAAW;AAEvB,SAAS,UAAU;AAmBnB,MAAM,mBAAmD;AAAA,EACvD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEO,MAAM,aAAa,MAAM;AAAA,EAC9B,CACE,EAAE,WAAW,MAAM,YAAY,MAAM,OAAO,MAAM,MAAM,GAAG,MAAM,GACjE,QACG;AACH,WACE,qBAAC,SAAI,WAAU,mBAAkB,iBAAe,MAC7C;AAAA,cACC,oBAAC,SAAI,WAAU,0EACZ,gBACH;AAAA,MAEF;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,iBAAiB,SAAS;AAAA,YAC1B;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO,mDAAmD;AAAA,YAC1D,OAAO,UAAU;AAAA,YACjB;AAAA,UACF;AAAA,UACA,OAAO;AAAA,YACL,gBAAgB;AAAA,UAClB;AAAA,UACC,GAAG;AAAA;AAAA,MACN;AAAA,OACF;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;","names":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
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_link_exports = {};
|
|
30
|
+
__export(craft_link_exports, {
|
|
31
|
+
CraftLink: () => CraftLink
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(craft_link_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_link = __toESM(require("next/link"), 1);
|
|
36
|
+
var import_cn = require("@/utils/cn");
|
|
37
|
+
const variantClasses = {
|
|
38
|
+
default: "text-[rgb(var(--nc-accent-1))] hover:text-[rgb(var(--nc-accent-1))]",
|
|
39
|
+
muted: "text-[rgb(var(--nc-fg-muted))] hover:text-[rgb(var(--nc-fg))]",
|
|
40
|
+
button: "inline-flex items-center rounded-xl border border-[rgb(var(--nc-border)/0.35)] bg-[rgb(var(--nc-surface)/0.12)] px-4 py-2 text-sm font-semibold text-[rgb(var(--nc-fg))] transition hover:bg-[rgb(var(--nc-surface)/0.2)]",
|
|
41
|
+
ghost: "inline-flex items-center rounded-xl px-4 py-2 text-sm font-semibold text-[rgb(var(--nc-fg))] transition hover:bg-[rgb(var(--nc-surface)/0.18)]"
|
|
42
|
+
};
|
|
43
|
+
function CraftLink({
|
|
44
|
+
variant = "default",
|
|
45
|
+
underline = false,
|
|
46
|
+
tone,
|
|
47
|
+
className,
|
|
48
|
+
children,
|
|
49
|
+
...props
|
|
50
|
+
}) {
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
52
|
+
import_link.default,
|
|
53
|
+
{
|
|
54
|
+
className: (0, import_cn.cn)(
|
|
55
|
+
"transition-colors",
|
|
56
|
+
variantClasses[variant],
|
|
57
|
+
underline && "underline underline-offset-4",
|
|
58
|
+
className
|
|
59
|
+
),
|
|
60
|
+
"data-nc-theme": tone,
|
|
61
|
+
...props,
|
|
62
|
+
children
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
CraftLink
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=craft-link.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-link.tsx"],"sourcesContent":["import * as React from \"react\";\nimport Link, { type LinkProps } from \"next/link\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\n\ntype CraftLinkVariant = \"default\" | \"muted\" | \"button\" | \"ghost\";\n\nexport type CraftLinkProps = LinkProps &\n React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n variant?: CraftLinkVariant;\n underline?: boolean;\n tone?: ThemeName;\n };\n\nconst variantClasses: Record<CraftLinkVariant, string> = {\n default:\n \"text-[rgb(var(--nc-accent-1))] hover:text-[rgb(var(--nc-accent-1))]\",\n muted: \"text-[rgb(var(--nc-fg-muted))] hover:text-[rgb(var(--nc-fg))]\",\n button:\n \"inline-flex items-center rounded-xl border border-[rgb(var(--nc-border)/0.35)] bg-[rgb(var(--nc-surface)/0.12)] px-4 py-2 text-sm font-semibold text-[rgb(var(--nc-fg))] transition hover:bg-[rgb(var(--nc-surface)/0.2)]\",\n ghost:\n \"inline-flex items-center rounded-xl px-4 py-2 text-sm font-semibold text-[rgb(var(--nc-fg))] transition hover:bg-[rgb(var(--nc-surface)/0.18)]\",\n};\n\nexport function CraftLink({\n variant = \"default\",\n underline = false,\n tone,\n className,\n children,\n ...props\n}: CraftLinkProps) {\n return (\n <Link\n className={cn(\n \"transition-colors\",\n variantClasses[variant],\n underline && \"underline underline-offset-4\",\n className\n )}\n data-nc-theme={tone}\n {...props}\n >\n {children}\n </Link>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkCI;AAjCJ,kBAAqC;AAErC,gBAAmB;AAYnB,MAAM,iBAAmD;AAAA,EACvD,SACE;AAAA,EACF,OAAO;AAAA,EACP,QACE;AAAA,EACF,OACE;AACJ;AAEO,SAAS,UAAU;AAAA,EACxB,UAAU;AAAA,EACV,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAmB;AACjB,SACE;AAAA,IAAC,YAAAA;AAAA,IAAA;AAAA,MACC,eAAW;AAAA,QACT;AAAA,QACA,eAAe,OAAO;AAAA,QACtB,aAAa;AAAA,QACb;AAAA,MACF;AAAA,MACA,iBAAe;AAAA,MACd,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":["Link"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { LinkProps } from 'next/link';
|
|
4
|
+
import { a as ThemeName } from '../theme-context-EVI9PfKv.cjs';
|
|
5
|
+
|
|
6
|
+
type CraftLinkVariant = "default" | "muted" | "button" | "ghost";
|
|
7
|
+
type CraftLinkProps = LinkProps & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
8
|
+
variant?: CraftLinkVariant;
|
|
9
|
+
underline?: boolean;
|
|
10
|
+
tone?: ThemeName;
|
|
11
|
+
};
|
|
12
|
+
declare function CraftLink({ variant, underline, tone, className, children, ...props }: CraftLinkProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { CraftLink, type CraftLinkProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { LinkProps } from 'next/link';
|
|
4
|
+
import { a as ThemeName } from '../theme-context-EVI9PfKv.js';
|
|
5
|
+
|
|
6
|
+
type CraftLinkVariant = "default" | "muted" | "button" | "ghost";
|
|
7
|
+
type CraftLinkProps = LinkProps & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
8
|
+
variant?: CraftLinkVariant;
|
|
9
|
+
underline?: boolean;
|
|
10
|
+
tone?: ThemeName;
|
|
11
|
+
};
|
|
12
|
+
declare function CraftLink({ variant, underline, tone, className, children, ...props }: CraftLinkProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { CraftLink, type CraftLinkProps };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
import { cn } from "@/utils/cn";
|
|
4
|
+
const variantClasses = {
|
|
5
|
+
default: "text-[rgb(var(--nc-accent-1))] hover:text-[rgb(var(--nc-accent-1))]",
|
|
6
|
+
muted: "text-[rgb(var(--nc-fg-muted))] hover:text-[rgb(var(--nc-fg))]",
|
|
7
|
+
button: "inline-flex items-center rounded-xl border border-[rgb(var(--nc-border)/0.35)] bg-[rgb(var(--nc-surface)/0.12)] px-4 py-2 text-sm font-semibold text-[rgb(var(--nc-fg))] transition hover:bg-[rgb(var(--nc-surface)/0.2)]",
|
|
8
|
+
ghost: "inline-flex items-center rounded-xl px-4 py-2 text-sm font-semibold text-[rgb(var(--nc-fg))] transition hover:bg-[rgb(var(--nc-surface)/0.18)]"
|
|
9
|
+
};
|
|
10
|
+
function CraftLink({
|
|
11
|
+
variant = "default",
|
|
12
|
+
underline = false,
|
|
13
|
+
tone,
|
|
14
|
+
className,
|
|
15
|
+
children,
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
Link,
|
|
20
|
+
{
|
|
21
|
+
className: cn(
|
|
22
|
+
"transition-colors",
|
|
23
|
+
variantClasses[variant],
|
|
24
|
+
underline && "underline underline-offset-4",
|
|
25
|
+
className
|
|
26
|
+
),
|
|
27
|
+
"data-nc-theme": tone,
|
|
28
|
+
...props,
|
|
29
|
+
children
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
CraftLink
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=craft-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-link.tsx"],"sourcesContent":["import * as React from \"react\";\nimport Link, { type LinkProps } from \"next/link\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\n\ntype CraftLinkVariant = \"default\" | \"muted\" | \"button\" | \"ghost\";\n\nexport type CraftLinkProps = LinkProps &\n React.AnchorHTMLAttributes<HTMLAnchorElement> & {\n variant?: CraftLinkVariant;\n underline?: boolean;\n tone?: ThemeName;\n };\n\nconst variantClasses: Record<CraftLinkVariant, string> = {\n default:\n \"text-[rgb(var(--nc-accent-1))] hover:text-[rgb(var(--nc-accent-1))]\",\n muted: \"text-[rgb(var(--nc-fg-muted))] hover:text-[rgb(var(--nc-fg))]\",\n button:\n \"inline-flex items-center rounded-xl border border-[rgb(var(--nc-border)/0.35)] bg-[rgb(var(--nc-surface)/0.12)] px-4 py-2 text-sm font-semibold text-[rgb(var(--nc-fg))] transition hover:bg-[rgb(var(--nc-surface)/0.2)]\",\n ghost:\n \"inline-flex items-center rounded-xl px-4 py-2 text-sm font-semibold text-[rgb(var(--nc-fg))] transition hover:bg-[rgb(var(--nc-surface)/0.18)]\",\n};\n\nexport function CraftLink({\n variant = \"default\",\n underline = false,\n tone,\n className,\n children,\n ...props\n}: CraftLinkProps) {\n return (\n <Link\n className={cn(\n \"transition-colors\",\n variantClasses[variant],\n underline && \"underline underline-offset-4\",\n className\n )}\n data-nc-theme={tone}\n {...props}\n >\n {children}\n </Link>\n );\n}\n"],"mappings":"AAkCI;AAjCJ,OAAO,UAA8B;AAErC,SAAS,UAAU;AAYnB,MAAM,iBAAmD;AAAA,EACvD,SACE;AAAA,EACF,OAAO;AAAA,EACP,QACE;AAAA,EACF,OACE;AACJ;AAEO,SAAS,UAAU;AAAA,EACxB,UAAU;AAAA,EACV,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAmB;AACjB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,eAAe,OAAO;AAAA,QACtB,aAAa;AAAA,QACb;AAAA,MACF;AAAA,MACA,iBAAe;AAAA,MACd,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
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_loading_state_exports = {};
|
|
20
|
+
__export(craft_loading_state_exports, {
|
|
21
|
+
CraftLoadingState: () => CraftLoadingState
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(craft_loading_state_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_cn = require("@/utils/cn");
|
|
26
|
+
const sizeClasses = {
|
|
27
|
+
sm: "h-4 w-4 border-2",
|
|
28
|
+
md: "h-6 w-6 border-2",
|
|
29
|
+
lg: "h-8 w-8 border-[3px]"
|
|
30
|
+
};
|
|
31
|
+
function CraftLoadingState({
|
|
32
|
+
label = "Loading...",
|
|
33
|
+
size = "md",
|
|
34
|
+
tone,
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}) {
|
|
38
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: (0, import_cn.cn)("flex items-center gap-3 text-[rgb(var(--nc-fg))]", className),
|
|
42
|
+
"data-nc-theme": tone,
|
|
43
|
+
...props,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
46
|
+
"span",
|
|
47
|
+
{
|
|
48
|
+
className: (0, import_cn.cn)(
|
|
49
|
+
"inline-block animate-spin rounded-full border-[rgb(var(--nc-accent-1)/0.25)] border-t-[rgb(var(--nc-accent-1))]",
|
|
50
|
+
sizeClasses[size]
|
|
51
|
+
),
|
|
52
|
+
"aria-hidden": "true"
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm text-[rgb(var(--nc-fg-muted))]", children: label })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
+
0 && (module.exports = {
|
|
62
|
+
CraftLoadingState
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=craft-loading-state.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-loading-state.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport type { ThemeName } from \"@/theme/theme-context\";\n\ntype CraftLoadingSize = \"sm\" | \"md\" | \"lg\";\n\nexport type CraftLoadingStateProps = React.HTMLAttributes<HTMLDivElement> & {\n label?: React.ReactNode;\n size?: CraftLoadingSize;\n tone?: ThemeName;\n};\n\nconst sizeClasses: Record<CraftLoadingSize, string> = {\n sm: \"h-4 w-4 border-2\",\n md: \"h-6 w-6 border-2\",\n lg: \"h-8 w-8 border-[3px]\",\n};\n\nexport function CraftLoadingState({\n label = \"Loading...\",\n size = \"md\",\n tone,\n className,\n ...props\n}: CraftLoadingStateProps) {\n return (\n <div\n className={cn(\"flex items-center gap-3 text-[rgb(var(--nc-fg))]\", className)}\n data-nc-theme={tone}\n {...props}\n >\n <span\n className={cn(\n \"inline-block animate-spin rounded-full border-[rgb(var(--nc-accent-1)/0.25)] border-t-[rgb(var(--nc-accent-1))]\",\n sizeClasses[size]\n )}\n aria-hidden=\"true\"\n />\n {label && <span className=\"text-sm text-[rgb(var(--nc-fg-muted))]\">{label}</span>}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BI;AAzBJ,gBAAmB;AAWnB,MAAM,cAAgD;AAAA,EACpD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEO,SAAS,kBAAkB;AAAA,EAChC,QAAQ;AAAA,EACR,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA2B;AACzB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAW,cAAG,oDAAoD,SAAS;AAAA,MAC3E,iBAAe;AAAA,MACd,GAAG;AAAA,MAEJ;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,eAAW;AAAA,cACT;AAAA,cACA,YAAY,IAAI;AAAA,YAClB;AAAA,YACA,eAAY;AAAA;AAAA,QACd;AAAA,QACC,SAAS,4CAAC,UAAK,WAAU,0CAA0C,iBAAM;AAAA;AAAA;AAAA,EAC5E;AAEJ;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { a as ThemeName } from '../theme-context-EVI9PfKv.cjs';
|
|
4
|
+
|
|
5
|
+
type CraftLoadingSize = "sm" | "md" | "lg";
|
|
6
|
+
type CraftLoadingStateProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
size?: CraftLoadingSize;
|
|
9
|
+
tone?: ThemeName;
|
|
10
|
+
};
|
|
11
|
+
declare function CraftLoadingState({ label, size, tone, className, ...props }: CraftLoadingStateProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { CraftLoadingState, type CraftLoadingStateProps };
|