azamat-ui-kit 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +104 -0
- package/COMPONENT_MATURITY.md +127 -0
- package/README.md +136 -62
- package/RELEASE.md +93 -0
- package/dist/cli/index.js +189 -39
- package/dist/components/actions/button-group.d.ts +15 -0
- package/dist/components/actions/copy-field.d.ts +11 -0
- package/dist/components/actions/index.d.ts +5 -3
- package/dist/components/calendar/calendar.d.ts +2 -0
- package/dist/components/charts/charts.d.ts +65 -0
- package/dist/components/charts/index.d.ts +1 -0
- package/dist/components/data-table/data-table.d.ts +3 -5
- package/dist/components/display/code-block.d.ts +10 -0
- package/dist/components/display/data-card.d.ts +13 -0
- package/dist/components/display/descriptions.d.ts +19 -0
- package/dist/components/display/file-card.d.ts +14 -0
- package/dist/components/display/index.d.ts +22 -10
- package/dist/components/display/kanban.d.ts +25 -0
- package/dist/components/display/keyboard-shortcut.d.ts +7 -0
- package/dist/components/display/list.d.ts +26 -0
- package/dist/components/display/property-grid.d.ts +15 -0
- package/dist/components/display/statistic.d.ts +23 -0
- package/dist/components/display/tag-list.d.ts +17 -0
- package/dist/components/display/tree-view.d.ts +19 -0
- package/dist/components/display/user-card.d.ts +13 -0
- package/dist/components/feedback/alert.d.ts +11 -0
- package/dist/components/feedback/index.d.ts +2 -0
- package/dist/components/feedback/page-state.d.ts +17 -0
- package/dist/components/inputs/async-select.d.ts +5 -4
- package/dist/components/inputs/color-input.d.ts +11 -0
- package/dist/components/inputs/index.d.ts +18 -14
- package/dist/components/inputs/otp-input.d.ts +17 -0
- package/dist/components/inputs/rating.d.ts +17 -0
- package/dist/components/inputs/slider.d.ts +24 -0
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/section.d.ts +24 -0
- package/dist/components/layout/sticky-footer-bar.d.ts +7 -0
- package/dist/components/navigation/anchor-nav.d.ts +15 -0
- package/dist/components/navigation/index.d.ts +4 -3
- package/dist/components/ui/collapse.d.ts +29 -0
- package/dist/components/ui/divider.d.ts +9 -0
- package/dist/components/ui/segmented-control.d.ts +17 -0
- package/dist/components/ui/skeleton.d.ts +17 -0
- package/dist/components/ui/spinner.d.ts +12 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/upload/file-upload.d.ts +11 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +40 -33
- package/dist/index.js +4333 -2903
- package/package.json +1 -112
- package/registry.json +1 -185
package/dist/cli/index.js
CHANGED
|
@@ -124,7 +124,8 @@ var azamatUiThemeCss = `${AZAMAT_UI_THEME_START}
|
|
|
124
124
|
--radius-4xl: calc(var(--radius) * 2.6);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
:root
|
|
127
|
+
:root,
|
|
128
|
+
.light {
|
|
128
129
|
--background: oklch(1 0 0);
|
|
129
130
|
--foreground: oklch(0.145 0 0);
|
|
130
131
|
--card: oklch(1 0 0);
|
|
@@ -328,90 +329,116 @@ var baseDependencies = [
|
|
|
328
329
|
"@tanstack/react-table",
|
|
329
330
|
"react-hook-form"
|
|
330
331
|
];
|
|
331
|
-
|
|
332
|
+
var templateDefaults = {
|
|
333
|
+
vite: {
|
|
334
|
+
alias: "@",
|
|
335
|
+
componentsPath: "src/components",
|
|
336
|
+
uiPath: "src/components/ui",
|
|
337
|
+
hooksPath: "src/hooks",
|
|
338
|
+
utilsPath: "src/lib/utils.ts",
|
|
339
|
+
globalCssPath: "src/index.css"
|
|
340
|
+
},
|
|
341
|
+
next: {
|
|
342
|
+
alias: "@",
|
|
343
|
+
componentsPath: "components",
|
|
344
|
+
uiPath: "components/ui",
|
|
345
|
+
hooksPath: "hooks",
|
|
346
|
+
utilsPath: "lib/utils.ts",
|
|
347
|
+
globalCssPath: "app/globals.css"
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
function resolveTemplate(value) {
|
|
351
|
+
if (value === "next" || value === "vite") return value;
|
|
352
|
+
logger.warn(`Unknown template '${value}'. Falling back to vite defaults.`);
|
|
353
|
+
return "vite";
|
|
354
|
+
}
|
|
355
|
+
async function initCommand(options = {}) {
|
|
332
356
|
const cwd = process.cwd();
|
|
333
357
|
const packageJsonPath = path3.join(cwd, "package.json");
|
|
334
358
|
if (!fs3.existsSync(packageJsonPath)) {
|
|
335
|
-
logger.error("package.json topilmadi. Commandni React
|
|
359
|
+
logger.error("package.json topilmadi / not found. Commandni React, Vite yoki Next project ichida ishlating.");
|
|
336
360
|
process.exit(1);
|
|
337
361
|
}
|
|
362
|
+
const defaults = templateDefaults[resolveTemplate(options.template)];
|
|
338
363
|
const response = await prompts([
|
|
339
364
|
{
|
|
340
365
|
type: "confirm",
|
|
341
366
|
name: "installDeps",
|
|
342
|
-
message: "Asosiy dependencylarni o\u2018rnataymi?",
|
|
343
|
-
initial:
|
|
367
|
+
message: "Asosiy dependencylarni o\u2018rnataymi? / Install base dependencies?",
|
|
368
|
+
initial: !options.skipInstall
|
|
344
369
|
},
|
|
345
370
|
{
|
|
346
371
|
type: "text",
|
|
347
372
|
name: "alias",
|
|
348
|
-
message: "Path alias qanday?",
|
|
349
|
-
initial:
|
|
373
|
+
message: "Path alias qanday? / Path alias?",
|
|
374
|
+
initial: defaults.alias
|
|
350
375
|
},
|
|
351
376
|
{
|
|
352
377
|
type: "text",
|
|
353
378
|
name: "componentsPath",
|
|
354
|
-
message: "Component root qayerda?",
|
|
355
|
-
initial:
|
|
379
|
+
message: "Component root qayerda? / Component root?",
|
|
380
|
+
initial: defaults.componentsPath
|
|
356
381
|
},
|
|
357
382
|
{
|
|
358
383
|
type: "text",
|
|
359
384
|
name: "uiPath",
|
|
360
|
-
message: "UI primitives qayerga yozilsin?",
|
|
361
|
-
initial:
|
|
385
|
+
message: "UI primitives qayerga yozilsin? / UI primitives path?",
|
|
386
|
+
initial: defaults.uiPath
|
|
362
387
|
},
|
|
363
388
|
{
|
|
364
389
|
type: "text",
|
|
365
390
|
name: "hooksPath",
|
|
366
|
-
message: "Hooks qayerga yozilsin?",
|
|
367
|
-
initial:
|
|
391
|
+
message: "Hooks qayerga yozilsin? / Hooks path?",
|
|
392
|
+
initial: defaults.hooksPath
|
|
368
393
|
},
|
|
369
394
|
{
|
|
370
395
|
type: "text",
|
|
371
396
|
name: "utilsPath",
|
|
372
|
-
message: "utils.ts qayerga yozilsin?",
|
|
373
|
-
initial:
|
|
397
|
+
message: "utils.ts qayerga yozilsin? / utils.ts path?",
|
|
398
|
+
initial: defaults.utilsPath
|
|
374
399
|
},
|
|
375
400
|
{
|
|
376
401
|
type: "text",
|
|
377
402
|
name: "globalCssPath",
|
|
378
|
-
message: "Theme tokenlar qaysi global CSS faylga yozilsin?",
|
|
379
|
-
initial:
|
|
403
|
+
message: "Theme tokenlar qaysi global CSS faylga yozilsin? / Global CSS path?",
|
|
404
|
+
initial: defaults.globalCssPath
|
|
380
405
|
},
|
|
381
406
|
{
|
|
382
407
|
type: "confirm",
|
|
383
408
|
name: "writeThemeCss",
|
|
384
|
-
message: "Dark/light theme tokenlarni global CSS faylga yozaymi?",
|
|
409
|
+
message: "Dark/light theme tokenlarni global CSS faylga yozaymi? / Write theme tokens?",
|
|
385
410
|
initial: true
|
|
386
411
|
}
|
|
387
412
|
]);
|
|
388
413
|
const packageManager = detectPackageManager(cwd);
|
|
389
414
|
logger.info(`Package manager: ${packageManager}`);
|
|
390
|
-
if (response.installDeps) {
|
|
415
|
+
if (!options.skipInstall && response.installDeps) {
|
|
391
416
|
await installPackages({
|
|
392
417
|
cwd,
|
|
393
418
|
packageManager,
|
|
394
419
|
packages: baseDependencies
|
|
395
420
|
});
|
|
396
421
|
}
|
|
422
|
+
const utilsPath = response.utilsPath || defaults.utilsPath;
|
|
423
|
+
const globalCssPath = response.globalCssPath || defaults.globalCssPath;
|
|
397
424
|
const config = {
|
|
398
425
|
style: "default",
|
|
399
|
-
alias: response.alias ||
|
|
400
|
-
componentsPath: response.uiPath,
|
|
401
|
-
utilsPath
|
|
402
|
-
cssPath:
|
|
403
|
-
globalCssPath
|
|
426
|
+
alias: response.alias || defaults.alias,
|
|
427
|
+
componentsPath: response.uiPath || defaults.uiPath,
|
|
428
|
+
utilsPath,
|
|
429
|
+
cssPath: globalCssPath,
|
|
430
|
+
globalCssPath,
|
|
404
431
|
paths: {
|
|
405
|
-
components: response.componentsPath,
|
|
406
|
-
ui: response.uiPath,
|
|
407
|
-
hooks: response.hooksPath,
|
|
408
|
-
lib: path3.dirname(
|
|
432
|
+
components: response.componentsPath || defaults.componentsPath,
|
|
433
|
+
ui: response.uiPath || defaults.uiPath,
|
|
434
|
+
hooks: response.hooksPath || defaults.hooksPath,
|
|
435
|
+
lib: path3.dirname(utilsPath)
|
|
409
436
|
}
|
|
410
437
|
};
|
|
411
438
|
await fs3.writeJson(path3.join(cwd, "azamat-ui.json"), config, {
|
|
412
439
|
spaces: 2
|
|
413
440
|
});
|
|
414
|
-
const utilsFullPath = path3.join(cwd,
|
|
441
|
+
const utilsFullPath = path3.join(cwd, utilsPath);
|
|
415
442
|
await fs3.ensureDir(path3.dirname(utilsFullPath));
|
|
416
443
|
if (!fs3.existsSync(utilsFullPath)) {
|
|
417
444
|
await fs3.writeFile(
|
|
@@ -425,19 +452,19 @@ export function cn(...inputs: ClassValue[]) {
|
|
|
425
452
|
`
|
|
426
453
|
);
|
|
427
454
|
}
|
|
428
|
-
if (response.writeThemeCss &&
|
|
455
|
+
if (response.writeThemeCss && globalCssPath) {
|
|
429
456
|
const cssTarget = await upsertThemeCss({
|
|
430
457
|
cwd,
|
|
431
|
-
cssPath:
|
|
458
|
+
cssPath: globalCssPath
|
|
432
459
|
});
|
|
433
|
-
logger.success(`Theme CSS yozildi: ${cssTarget}`);
|
|
460
|
+
logger.success(`Theme CSS yozildi / written: ${cssTarget}`);
|
|
434
461
|
}
|
|
435
|
-
logger.success("Azamat UI Kit init qilindi.");
|
|
436
|
-
logger.info("Componentlarni ko\u2018rish:");
|
|
462
|
+
logger.success("Azamat UI Kit init qilindi / initialized.");
|
|
463
|
+
logger.info("Componentlarni ko\u2018rish / list components:");
|
|
437
464
|
logger.info("npx azamat-ui-kit list");
|
|
438
|
-
logger.info("Component qo\u2018shish:");
|
|
465
|
+
logger.info("Component qo\u2018shish / add components:");
|
|
439
466
|
logger.info("npx azamat-ui-kit add button input data-table");
|
|
440
|
-
logger.info("Theme CSS ni yangilash:");
|
|
467
|
+
logger.info("Theme CSS ni yangilash / update theme CSS:");
|
|
441
468
|
logger.info("npx azamat-ui-kit theme");
|
|
442
469
|
}
|
|
443
470
|
|
|
@@ -681,6 +708,123 @@ async function addCommand(components, options = {}) {
|
|
|
681
708
|
logger.success("Componentlar muvaffaqiyatli qo\u2018shildi.");
|
|
682
709
|
}
|
|
683
710
|
|
|
711
|
+
// cli/registry-status.ts
|
|
712
|
+
var registryStatus = {
|
|
713
|
+
utils: "internal",
|
|
714
|
+
button: "stable",
|
|
715
|
+
input: "stable",
|
|
716
|
+
textarea: "stable",
|
|
717
|
+
checkbox: "stable",
|
|
718
|
+
switch: "stable",
|
|
719
|
+
badge: "stable",
|
|
720
|
+
card: "stable",
|
|
721
|
+
dialog: "stable",
|
|
722
|
+
"dropdown-menu": "stable",
|
|
723
|
+
popover: "stable",
|
|
724
|
+
select: "stable",
|
|
725
|
+
table: "stable",
|
|
726
|
+
"dialog-actions": "stable",
|
|
727
|
+
"modal-shell": "stable",
|
|
728
|
+
"confirm-dialog": "stable",
|
|
729
|
+
"sheet-shell": "stable",
|
|
730
|
+
overlay: "stable",
|
|
731
|
+
pagination: "stable",
|
|
732
|
+
"clearable-input": "preview",
|
|
733
|
+
"search-input": "preview",
|
|
734
|
+
"password-input": "preview",
|
|
735
|
+
"number-input": "preview",
|
|
736
|
+
"date-input": "preview",
|
|
737
|
+
"date-range-input": "preview",
|
|
738
|
+
"money-input": "preview",
|
|
739
|
+
"quantity-input": "preview",
|
|
740
|
+
"masked-input": "preview",
|
|
741
|
+
"phone-input": "preview",
|
|
742
|
+
"simple-select": "preview",
|
|
743
|
+
"async-select": "preview",
|
|
744
|
+
inputs: "preview",
|
|
745
|
+
"form-field-shell": "preview",
|
|
746
|
+
"form-input": "preview",
|
|
747
|
+
"form-select": "preview",
|
|
748
|
+
"form-async-select": "preview",
|
|
749
|
+
"form-textarea": "preview",
|
|
750
|
+
"form-switch": "preview",
|
|
751
|
+
"form-search-input": "preview",
|
|
752
|
+
"form-password-input": "preview",
|
|
753
|
+
"form-number-input": "preview",
|
|
754
|
+
"form-phone-input": "preview",
|
|
755
|
+
"form-date-input": "preview",
|
|
756
|
+
"form-date-range-input": "preview",
|
|
757
|
+
"form-date-picker": "preview",
|
|
758
|
+
"form-date-range-picker": "preview",
|
|
759
|
+
form: "preview",
|
|
760
|
+
"empty-state": "stable",
|
|
761
|
+
"loading-state": "stable",
|
|
762
|
+
"status-badge": "stable",
|
|
763
|
+
feedback: "stable",
|
|
764
|
+
"description-list": "stable",
|
|
765
|
+
progress: "stable",
|
|
766
|
+
result: "stable",
|
|
767
|
+
timeline: "stable",
|
|
768
|
+
"metric-grid": "stable",
|
|
769
|
+
"info-card": "stable",
|
|
770
|
+
"activity-feed": "stable",
|
|
771
|
+
display: "stable",
|
|
772
|
+
"action-menu": "stable",
|
|
773
|
+
actions: "stable",
|
|
774
|
+
"page-header": "stable",
|
|
775
|
+
"stat-card": "stable",
|
|
776
|
+
"app-shell": "stable",
|
|
777
|
+
"app-header": "stable",
|
|
778
|
+
"app-sidebar": "stable",
|
|
779
|
+
"sidebar-nav": "stable",
|
|
780
|
+
breadcrumbs: "stable",
|
|
781
|
+
"page-container": "stable",
|
|
782
|
+
layout: "stable",
|
|
783
|
+
"filter-bar": "stable",
|
|
784
|
+
filters: "stable",
|
|
785
|
+
"data-table-toolbar": "preview",
|
|
786
|
+
"data-table-pagination": "preview",
|
|
787
|
+
"data-table-column-visibility-menu": "preview",
|
|
788
|
+
"data-table-select-column": "preview",
|
|
789
|
+
"data-table-sortable-header": "preview",
|
|
790
|
+
"data-table-row-actions": "preview",
|
|
791
|
+
"data-table-actions-column": "preview",
|
|
792
|
+
"data-table-bulk-actions": "preview",
|
|
793
|
+
"data-table-view-presets": "preview",
|
|
794
|
+
"data-table": "preview",
|
|
795
|
+
calendar: "preview",
|
|
796
|
+
"date-picker": "preview",
|
|
797
|
+
"date-range-picker": "preview",
|
|
798
|
+
"calendar-kit": "preview",
|
|
799
|
+
"file-upload": "preview",
|
|
800
|
+
"image-upload": "preview",
|
|
801
|
+
upload: "preview",
|
|
802
|
+
stepper: "preview",
|
|
803
|
+
wizard: "preview",
|
|
804
|
+
"wizard-kit": "preview",
|
|
805
|
+
toast: "preview",
|
|
806
|
+
notifications: "preview",
|
|
807
|
+
"command-palette": "preview",
|
|
808
|
+
command: "preview",
|
|
809
|
+
"resource-page": "preview",
|
|
810
|
+
"resource-detail-page": "preview",
|
|
811
|
+
"form-builder": "experimental",
|
|
812
|
+
"form-builder-presets": "experimental",
|
|
813
|
+
patterns: "preview",
|
|
814
|
+
"use-session-storage-state": "stable",
|
|
815
|
+
"use-before-unload-when-dirty": "stable",
|
|
816
|
+
"use-is-mobile": "stable",
|
|
817
|
+
"use-disclosure": "stable",
|
|
818
|
+
"use-debounce": "stable",
|
|
819
|
+
"use-data-table-view-state": "preview",
|
|
820
|
+
hooks: "stable",
|
|
821
|
+
dashboard: "preview",
|
|
822
|
+
all: "preview"
|
|
823
|
+
};
|
|
824
|
+
function getRegistryStatus(name) {
|
|
825
|
+
return registryStatus[name] ?? "preview";
|
|
826
|
+
}
|
|
827
|
+
|
|
684
828
|
// cli/commands/list.ts
|
|
685
829
|
function listCommand() {
|
|
686
830
|
const grouped = registryNames.filter((name) => registry[name].category !== "lib").reduce((acc, name) => {
|
|
@@ -694,10 +838,16 @@ function listCommand() {
|
|
|
694
838
|
${category}`);
|
|
695
839
|
names.sort().forEach((name) => {
|
|
696
840
|
const item = registry[name];
|
|
841
|
+
const status = getRegistryStatus(name);
|
|
697
842
|
const deps = item.registryDependencies?.length ? ` -> ${item.registryDependencies.join(", ")}` : "";
|
|
698
|
-
console.log(` ${name}${deps}`);
|
|
843
|
+
console.log(` ${name} [${status}]${deps}`);
|
|
699
844
|
});
|
|
700
845
|
}
|
|
846
|
+
console.log("\nStatus:");
|
|
847
|
+
console.log(" stable = safe public API");
|
|
848
|
+
console.log(" preview = usable but API may change");
|
|
849
|
+
console.log(" experimental = not ready for stable app contracts");
|
|
850
|
+
console.log(" internal = helper metadata");
|
|
701
851
|
console.log("\nUsage:");
|
|
702
852
|
console.log(" npx azamat-ui-kit add button input data-table");
|
|
703
853
|
console.log(" npx azamat-ui-kit add form --overwrite");
|
|
@@ -717,8 +867,8 @@ async function themeCommand(cssPathArg) {
|
|
|
717
867
|
|
|
718
868
|
// cli/index.ts
|
|
719
869
|
var program = new Command();
|
|
720
|
-
program.name("azamat-ui-kit").description("Azamat UI Kit CLI").version("0.
|
|
721
|
-
program.command("init").description("Initialize Azamat UI Kit in your project").action(initCommand);
|
|
870
|
+
program.name("azamat-ui-kit").description("Azamat UI Kit CLI").version("0.1.1");
|
|
871
|
+
program.command("init").description("Initialize Azamat UI Kit in your project").option("--template <template>", "Project defaults: vite or next", "vite").option("--skip-install", "Do not install base dependencies").action(initCommand);
|
|
722
872
|
program.command("list").description("List available registry components").action(listCommand);
|
|
723
873
|
program.command("add").description("Add components to your project").argument("[components...]", "components to add").option("-o, --overwrite", "overwrite existing files").option("--dry-run", "show files without writing").option("--skip-install", "do not install package dependencies").action(addCommand);
|
|
724
874
|
program.command("theme").description("Write or update Azamat UI theme CSS in your global CSS file").argument("[cssPath]", "global CSS path, default from azamat-ui.json or src/index.css").action(themeCommand);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Button } from "@/components/ui/button";
|
|
3
|
+
type ButtonProps = React.ComponentProps<typeof Button>;
|
|
4
|
+
export type ButtonGroupItem = Omit<ButtonProps, "children"> & {
|
|
5
|
+
key: string;
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export type ButtonGroupProps = React.ComponentProps<"div"> & {
|
|
9
|
+
items?: ButtonGroupItem[];
|
|
10
|
+
attached?: boolean;
|
|
11
|
+
size?: ButtonProps["size"];
|
|
12
|
+
variant?: ButtonProps["variant"];
|
|
13
|
+
};
|
|
14
|
+
declare function ButtonGroup({ items, attached, size, variant, className, children, ...props }: ButtonGroupProps): React.JSX.Element;
|
|
15
|
+
export { ButtonGroup };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type CopyButtonProps } from "@/components/actions/copy-button";
|
|
3
|
+
export type CopyFieldProps = React.ComponentProps<"div"> & {
|
|
4
|
+
value: string;
|
|
5
|
+
label?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
copyButtonProps?: Omit<CopyButtonProps, "value">;
|
|
8
|
+
monospace?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare function CopyField({ value, label, description, copyButtonProps, monospace, className, ...props }: CopyFieldProps): React.JSX.Element;
|
|
11
|
+
export { CopyField };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from './action-menu';
|
|
2
|
+
export * from './copy-button';
|
|
3
|
+
export * from './copy-field';
|
|
4
|
+
export * from './button-group';
|
|
5
|
+
export * from './quick-action-grid';
|
|
@@ -3,10 +3,12 @@ export type CalendarDateRange = {
|
|
|
3
3
|
from?: string | null;
|
|
4
4
|
to?: string | null;
|
|
5
5
|
};
|
|
6
|
+
export type CalendarDisabledReason = "disabled" | "min" | "max" | "range";
|
|
6
7
|
export type CalendarLabels = {
|
|
7
8
|
previousMonth?: string;
|
|
8
9
|
nextMonth?: string;
|
|
9
10
|
selectDate?: (date: string) => string;
|
|
11
|
+
disabledDate?: (date: string, reason: CalendarDisabledReason) => string;
|
|
10
12
|
};
|
|
11
13
|
export type CalendarProps = React.ComponentProps<"div"> & {
|
|
12
14
|
value?: string | null;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Card } from "@/components/ui/card";
|
|
3
|
+
export type ChartDatum = {
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
value: number;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
color?: string;
|
|
8
|
+
};
|
|
9
|
+
export type ChartSeries = {
|
|
10
|
+
key: string;
|
|
11
|
+
label: React.ReactNode;
|
|
12
|
+
data: number[];
|
|
13
|
+
color?: string;
|
|
14
|
+
};
|
|
15
|
+
export type ChartAxisLabel = string | number | React.ReactNode;
|
|
16
|
+
export type ChartSize = "sm" | "md" | "lg";
|
|
17
|
+
export type ChartFrameProps = React.ComponentProps<typeof Card> & {
|
|
18
|
+
title?: React.ReactNode;
|
|
19
|
+
description?: React.ReactNode;
|
|
20
|
+
action?: React.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
declare function ChartFrame({ title, description, action, className, children, ...props }: ChartFrameProps): React.JSX.Element;
|
|
23
|
+
export type BarChartProps = React.ComponentProps<"div"> & {
|
|
24
|
+
data: ChartDatum[];
|
|
25
|
+
size?: ChartSize;
|
|
26
|
+
max?: number;
|
|
27
|
+
showLabels?: boolean;
|
|
28
|
+
showValues?: boolean;
|
|
29
|
+
barClassName?: string;
|
|
30
|
+
};
|
|
31
|
+
declare function BarChart({ data, size, max, showLabels, showValues, className, barClassName, ...props }: BarChartProps): React.JSX.Element;
|
|
32
|
+
export type LineChartProps = Omit<React.ComponentProps<"svg">, "values"> & {
|
|
33
|
+
values: number[];
|
|
34
|
+
size?: ChartSize;
|
|
35
|
+
width?: number;
|
|
36
|
+
showArea?: boolean;
|
|
37
|
+
stroke?: string;
|
|
38
|
+
};
|
|
39
|
+
declare function LineChart({ values, size, width, showArea, stroke, className, ...props }: LineChartProps): React.JSX.Element;
|
|
40
|
+
export type SparklineProps = Omit<LineChartProps, "size" | "showArea"> & {
|
|
41
|
+
values: number[];
|
|
42
|
+
positive?: boolean;
|
|
43
|
+
};
|
|
44
|
+
declare function Sparkline({ values, positive, stroke, className, ...props }: SparklineProps): React.JSX.Element;
|
|
45
|
+
export type DonutChartProps = React.ComponentProps<"svg"> & {
|
|
46
|
+
data: ChartDatum[];
|
|
47
|
+
size?: number;
|
|
48
|
+
strokeWidth?: number;
|
|
49
|
+
centerLabel?: React.ReactNode;
|
|
50
|
+
centerValue?: React.ReactNode;
|
|
51
|
+
};
|
|
52
|
+
declare function DonutChart({ data, size, strokeWidth, centerLabel, centerValue, className, ...props }: DonutChartProps): React.JSX.Element;
|
|
53
|
+
export type ChartLegendProps = React.ComponentProps<"div"> & {
|
|
54
|
+
data: ChartDatum[];
|
|
55
|
+
};
|
|
56
|
+
declare function ChartLegend({ data, className, ...props }: ChartLegendProps): React.JSX.Element;
|
|
57
|
+
export type MetricTrendProps = React.ComponentProps<"div"> & {
|
|
58
|
+
label: React.ReactNode;
|
|
59
|
+
value: React.ReactNode;
|
|
60
|
+
change?: React.ReactNode;
|
|
61
|
+
positive?: boolean;
|
|
62
|
+
values?: number[];
|
|
63
|
+
};
|
|
64
|
+
declare function MetricTrend({ label, value, change, positive, values, className, ...props }: MetricTrendProps): React.JSX.Element;
|
|
65
|
+
export { BarChart, ChartFrame, ChartLegend, DonutChart, LineChart, MetricTrend, Sparkline };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./charts";
|
|
@@ -6,6 +6,7 @@ import { type DataTableRowAction } from "@/components/data-table/data-table-row-
|
|
|
6
6
|
import { type DataTableToolbarProps } from "@/components/data-table/data-table-toolbar";
|
|
7
7
|
import { type EmptyStateProps } from "@/components/feedback/empty-state";
|
|
8
8
|
import { type LoadingStateProps } from "@/components/feedback/loading-state";
|
|
9
|
+
import { type SearchInputProps } from "@/components/inputs/search-input";
|
|
9
10
|
export type DataTableDensity = "compact" | "default" | "comfortable";
|
|
10
11
|
export type DataTableLoadingVariant = "skeleton" | "state";
|
|
11
12
|
export type DataTableFeatureConfig = {
|
|
@@ -16,12 +17,9 @@ export type DataTableFeatureConfig = {
|
|
|
16
17
|
refresh?: boolean;
|
|
17
18
|
export?: boolean;
|
|
18
19
|
};
|
|
19
|
-
export type DataTableSearchConfig = {
|
|
20
|
-
value: string;
|
|
21
|
-
onValueChange: (value: string) => void;
|
|
22
|
-
placeholder?: string;
|
|
20
|
+
export type DataTableSearchConfig = Pick<SearchInputProps, "value" | "onValueChange" | "placeholder" | "inputClassName" | "disabled" | "clearable" | "clearLabel" | "searchIcon"> & {
|
|
23
21
|
className?: string;
|
|
24
|
-
|
|
22
|
+
wrapperClassName?: string;
|
|
25
23
|
};
|
|
26
24
|
export type DataTableActionContext<TData> = {
|
|
27
25
|
table: TanStackTable<TData>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type CodeBlockProps = React.ComponentProps<"div"> & {
|
|
3
|
+
code: string;
|
|
4
|
+
language?: string;
|
|
5
|
+
title?: React.ReactNode;
|
|
6
|
+
showCopy?: boolean;
|
|
7
|
+
wrap?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare function CodeBlock({ code, language, title, showCopy, wrap, className, ...props }: CodeBlockProps): React.JSX.Element;
|
|
10
|
+
export { CodeBlock };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Card } from "@/components/ui/card";
|
|
3
|
+
export type DataCardProps = React.ComponentProps<typeof Card> & {
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
value?: React.ReactNode;
|
|
7
|
+
meta?: React.ReactNode;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
action?: React.ReactNode;
|
|
10
|
+
footer?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
declare function DataCard({ title, description, value, meta, icon, action, footer, className, children, ...props }: DataCardProps): React.JSX.Element;
|
|
13
|
+
export { DataCard };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type DescriptionItem = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
value: React.ReactNode;
|
|
6
|
+
span?: 1 | 2 | 3 | 4;
|
|
7
|
+
};
|
|
8
|
+
export type DescriptionsProps = React.ComponentProps<"div"> & {
|
|
9
|
+
items: DescriptionItem[];
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
extra?: React.ReactNode;
|
|
12
|
+
bordered?: boolean;
|
|
13
|
+
columns?: 1 | 2 | 3 | 4;
|
|
14
|
+
size?: "sm" | "md" | "lg";
|
|
15
|
+
labelClassName?: string;
|
|
16
|
+
valueClassName?: string;
|
|
17
|
+
};
|
|
18
|
+
declare function Descriptions({ items, title, extra, bordered, columns, size, labelClassName, valueClassName, className, ...props }: DescriptionsProps): React.JSX.Element;
|
|
19
|
+
export { Descriptions };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type FileCardProps = React.ComponentProps<"div"> & {
|
|
3
|
+
name: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
meta?: React.ReactNode;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
preview?: React.ReactNode;
|
|
8
|
+
actions?: React.ReactNode;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
onOpen?: () => void;
|
|
12
|
+
};
|
|
13
|
+
declare function FileCard({ name, description, meta, icon, preview, actions, selected, disabled, onOpen, className, ...props }: FileCardProps): React.JSX.Element;
|
|
14
|
+
export { FileCard };
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
1
|
+
export * from './description-list';
|
|
2
|
+
export * from './progress';
|
|
3
|
+
export * from './result';
|
|
4
|
+
export * from './timeline';
|
|
5
|
+
export * from './metric-grid';
|
|
6
|
+
export * from './info-card';
|
|
7
|
+
export * from './activity-feed';
|
|
8
|
+
export * from './status-legend';
|
|
9
|
+
export * from './avatar';
|
|
10
|
+
export * from './data-state';
|
|
11
|
+
export * from './statistic';
|
|
12
|
+
export * from './list';
|
|
13
|
+
export * from './descriptions';
|
|
14
|
+
export * from './kanban';
|
|
15
|
+
export * from './tag-list';
|
|
16
|
+
export * from './tree-view';
|
|
17
|
+
export * from './keyboard-shortcut';
|
|
18
|
+
export * from './code-block';
|
|
19
|
+
export * from './file-card';
|
|
20
|
+
export * from './property-grid';
|
|
21
|
+
export * from './data-card';
|
|
22
|
+
export * from './user-card';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type KanbanCard = {
|
|
3
|
+
key: string;
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
meta?: React.ReactNode;
|
|
7
|
+
extra?: React.ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type KanbanColumn = {
|
|
11
|
+
key: string;
|
|
12
|
+
title: React.ReactNode;
|
|
13
|
+
description?: React.ReactNode;
|
|
14
|
+
cards: KanbanCard[];
|
|
15
|
+
count?: React.ReactNode;
|
|
16
|
+
};
|
|
17
|
+
export type KanbanBoardProps = React.ComponentProps<"div"> & {
|
|
18
|
+
columns: KanbanColumn[];
|
|
19
|
+
renderCard?: (card: KanbanCard, column: KanbanColumn) => React.ReactNode;
|
|
20
|
+
onCardClick?: (card: KanbanCard, column: KanbanColumn) => void;
|
|
21
|
+
columnClassName?: string;
|
|
22
|
+
cardClassName?: string;
|
|
23
|
+
};
|
|
24
|
+
declare function KanbanBoard({ columns, renderCard, onCardClick, columnClassName, cardClassName, className, ...props }: KanbanBoardProps): React.JSX.Element;
|
|
25
|
+
export { KanbanBoard };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type KeyboardShortcutProps = React.ComponentProps<"kbd"> & {
|
|
3
|
+
keys?: React.ReactNode[];
|
|
4
|
+
separator?: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
declare function KeyboardShortcut({ keys, separator, className, children, ...props }: KeyboardShortcutProps): React.JSX.Element;
|
|
7
|
+
export { KeyboardShortcut };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type ListItem = {
|
|
3
|
+
key: string;
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
avatar?: React.ReactNode;
|
|
7
|
+
extra?: React.ReactNode;
|
|
8
|
+
href?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
};
|
|
12
|
+
export type ListProps = React.ComponentProps<"div"> & {
|
|
13
|
+
items?: ListItem[];
|
|
14
|
+
bordered?: boolean;
|
|
15
|
+
split?: boolean;
|
|
16
|
+
size?: "sm" | "md" | "lg";
|
|
17
|
+
renderItem?: (item: ListItem, index: number) => React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
declare function List({ items, bordered, split, size, renderItem, className, children, ...props }: ListProps): React.JSX.Element;
|
|
20
|
+
export type ListRowProps = React.ComponentProps<"div"> & {
|
|
21
|
+
item: ListItem;
|
|
22
|
+
split?: boolean;
|
|
23
|
+
size?: "sm" | "md" | "lg";
|
|
24
|
+
};
|
|
25
|
+
declare function ListRow({ item, split, size, className, ...props }: ListRowProps): React.JSX.Element;
|
|
26
|
+
export { List, ListRow };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type PropertyGridItem = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
value: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
span?: 1 | 2 | 3 | 4;
|
|
8
|
+
};
|
|
9
|
+
export type PropertyGridProps = React.ComponentProps<"div"> & {
|
|
10
|
+
items: PropertyGridItem[];
|
|
11
|
+
columns?: 1 | 2 | 3 | 4;
|
|
12
|
+
bordered?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare function PropertyGrid({ items, columns, bordered, className, ...props }: PropertyGridProps): React.JSX.Element;
|
|
15
|
+
export { PropertyGrid };
|