@godxjp/ui 18.2.0 → 18.3.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/README.md +1 -1
- package/dist/components/data-display/index.d.ts +3 -0
- package/dist/components/data-display/index.js +2 -0
- package/dist/components/data-display/qr-code.d.ts +8 -0
- package/dist/components/data-display/qr-code.js +34 -0
- package/dist/props/components/data-display.prop.d.ts +11 -0
- package/dist/props/components/index.d.ts +1 -1
- package/dist/props/registry.d.ts +5 -0
- package/dist/props/registry.js +5 -0
- package/dist/styles/data-display-layout.css +19 -0
- package/dist/styles/dialog-layout.css +4 -0
- package/dist/tokens/components/data-display.css +9 -0
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ Components emit `data-slot` / `data-*`; the look lives in `styles/*-layout.css`.
|
|
|
70
70
|
| **Layout** | `@godxjp/ui/layout` | `Flex`, `PageContainer`, `ResponsiveGrid`, `AppShell`, `Sidebar`, `Separator`, `AspectRatio`, `Resizable` |
|
|
71
71
|
| **General** | `@godxjp/ui/general` | `Button` |
|
|
72
72
|
| **Data Entry** | `@godxjp/ui/data-entry` | `Input`, `Select`, `FormField`, `Field`, `DatePicker`, `TimePicker`, `Combobox`, `Switch`, `Toggle`, `Upload`, `Cascader`, `TreeSelect`, `ColorPicker`, `Slider`, `PasswordInput`, `PasswordStrength`, `InputOTP`, `Rating`, `TagInput` |
|
|
73
|
-
| **Data Display** | `@godxjp/ui/data-display` | `Table`, `DataTable`, `Card`, `StatCard`, `Badge`, `Avatar`, `Descriptions`, `Timeline`, `EmptyState`, `Progress`, `Accordion`, `HoverCard`, `Carousel`, `Popover`, `Collapsible`
|
|
73
|
+
| **Data Display** | `@godxjp/ui/data-display` | `Table`, `DataTable`, `Card`, `StatCard`, `Badge`, `Avatar`, `Descriptions`, `Timeline`, `EmptyState`, `Progress`, `QrCode`, `CredentialReveal`, `Accordion`, `HoverCard`, `Carousel`, `Popover`, `Collapsible` |
|
|
74
74
|
| **Feedback** | `@godxjp/ui/feedback` | `Dialog`, `AlertDialog`, `Sheet` (side), `Drawer` (bottom-sheet), `Toast`, `Skeleton`, `Alert`, `Tooltip` |
|
|
75
75
|
| **Query** | `@godxjp/ui/query` | `DataState`, `InfiniteQueryState`, `PrefetchLink` (adapter subpath — pulls TanStack Query) |
|
|
76
76
|
| **Navigation** | `@godxjp/ui/navigation` | `Tabs`, `Toolbar`, `DropdownMenu`, `ContextMenu`, `Menubar`, `NavigationMenu`, `Steps`, `Pagination`, `Breadcrumb`, `AppSettingPicker` |
|
|
@@ -4,6 +4,9 @@ export { ListRow } from "./list-row.js";
|
|
|
4
4
|
export type { ListRowProps } from "./list-row.js";
|
|
5
5
|
export { CredentialReveal } from "./credential-reveal.js";
|
|
6
6
|
export type { CredentialRevealProp, CredentialRevealProps, CredentialRevealTone, } from "./credential-reveal.js";
|
|
7
|
+
export { QrCode } from "./qr-code.js";
|
|
8
|
+
export type { QrCodeProps } from "./qr-code.js";
|
|
9
|
+
export type { QrCodeProp } from "../../props/components/data-display.prop.js";
|
|
7
10
|
export { Avatar, AvatarImage, AvatarFallback } from "./avatar.js";
|
|
8
11
|
export { Card, CardBar, CardContent, CardCover, CardDescription, CardFooter, CardHeader, CardTitle, CardAction, StatCard, } from "./card.js";
|
|
9
12
|
export type { StatCardProps, CardBarProps } from "./card.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Badge } from "./badge.js";
|
|
2
2
|
import { ListRow } from "./list-row.js";
|
|
3
3
|
import { CredentialReveal } from "./credential-reveal.js";
|
|
4
|
+
import { QrCode } from "./qr-code.js";
|
|
4
5
|
import { Avatar, AvatarImage, AvatarFallback } from "./avatar.js";
|
|
5
6
|
import {
|
|
6
7
|
Card,
|
|
@@ -86,6 +87,7 @@ export {
|
|
|
86
87
|
PopoverTitle,
|
|
87
88
|
PopoverTrigger,
|
|
88
89
|
Progress,
|
|
90
|
+
QrCode,
|
|
89
91
|
ScrollArea,
|
|
90
92
|
ScrollBar,
|
|
91
93
|
StatCard,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { QrCodeProp } from "../../props/components/data-display.prop.js";
|
|
3
|
+
export type QrCodeProps = QrCodeProp & Omit<React.ComponentPropsWithoutRef<"svg">, keyof QrCodeProp | "children" | "role" | "style" | "type">;
|
|
4
|
+
/**
|
|
5
|
+
* Renders a QR code entirely in-process. The encoded value is never sent to a network service,
|
|
6
|
+
* written to an element attribute, or included in accessible text.
|
|
7
|
+
*/
|
|
8
|
+
export declare const QrCode: React.ForwardRefExoticComponent<QrCodeProp & Omit<Omit<React.SVGProps<SVGSVGElement>, "ref">, "style" | "children" | "role" | "type" | keyof QrCodeProp> & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { QRCodeSVG } from "qrcode.react";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
const QR_INTRINSIC_SIZE = 256;
|
|
6
|
+
const QrCode = React.forwardRef(
|
|
7
|
+
({ value, label, size = "md", className, ...props }, ref) => {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
QRCodeSVG,
|
|
10
|
+
{
|
|
11
|
+
ref,
|
|
12
|
+
...props,
|
|
13
|
+
value,
|
|
14
|
+
title: label,
|
|
15
|
+
size: QR_INTRINSIC_SIZE,
|
|
16
|
+
level: "M",
|
|
17
|
+
boostLevel: true,
|
|
18
|
+
marginSize: 4,
|
|
19
|
+
bgColor: "hsl(var(--qr-code-background))",
|
|
20
|
+
fgColor: "hsl(var(--qr-code-foreground))",
|
|
21
|
+
role: "img",
|
|
22
|
+
"aria-label": label,
|
|
23
|
+
focusable: "false",
|
|
24
|
+
"data-slot": "qr-code",
|
|
25
|
+
"data-size": size,
|
|
26
|
+
className: cn("ui-qr-code", className)
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
QrCode.displayName = "QrCode";
|
|
32
|
+
export {
|
|
33
|
+
QrCode
|
|
34
|
+
};
|
|
@@ -110,6 +110,17 @@ export type CredentialRevealProp = {
|
|
|
110
110
|
id?: IdProp;
|
|
111
111
|
"aria-label"?: string;
|
|
112
112
|
};
|
|
113
|
+
/** @see QrCode */
|
|
114
|
+
export type QrCodeProp = {
|
|
115
|
+
/** Sensitive or public value encoded locally into the QR modules. */
|
|
116
|
+
value: string;
|
|
117
|
+
/** Purpose-specific accessible name. The encoded value is never used as accessible text. */
|
|
118
|
+
label: string;
|
|
119
|
+
/** Natural display size. Default `md`. */
|
|
120
|
+
size?: SizeProp;
|
|
121
|
+
className?: ClassNameProp;
|
|
122
|
+
id?: IdProp;
|
|
123
|
+
};
|
|
113
124
|
/** @see DataTable */
|
|
114
125
|
export type DataTableProp<T> = {
|
|
115
126
|
data: T[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { AppShellProp, PageContainerProp, PageInsetProp, SidebarItemProp, SidebarProductProp, SidebarProp, SidebarSectionProp, TopbarProp, } from "./layout.prop.js";
|
|
2
2
|
export type { ButtonProp } from "./general.prop.js";
|
|
3
3
|
export type { InputProp, TextareaProp, FormFieldProp, SearchInputProp, CheckboxProp, CheckboxGroupProp, ChoiceOptionProp, RadioProp, RadioGroupProp, SwitchProp, SliderProp, CalendarProp, DatePickerProp, DateRangePickerProp, TimePickerProp, ColorPickerProp, UploadProp, UploadFileItemProp, UploadVariantProp, TreeOptionProp, TreeFieldNamesProp, CascaderProp, TreeSelectProp, ShowCheckedStrategyProp, TransferProp, TransferItemProp, } from "./data-entry.prop.js";
|
|
4
|
-
export type { EmptyStateProp, DescriptionsProp, DescriptionsItemProp, BadgeProp, DataTableProp, } from "./data-display.prop.js";
|
|
4
|
+
export type { EmptyStateProp, DescriptionsProp, DescriptionsItemProp, BadgeProp, DataTableProp, QrCodeProp, } from "./data-display.prop.js";
|
|
5
5
|
export type { ChartDatum, ChartSeriesProp, LineChartProp, BarChartProp, AreaChartProp, PieChartProp, } from "./charts.prop.js";
|
|
6
6
|
export type { AlertQueryErrorProp, AlertProp, AlertTitleProp, AlertContentProp, AlertDescriptionProp, AlertActionsProp, SkeletonRowsProp, } from "./feedback.prop.js";
|
|
7
7
|
export type { DataStateProp, InfiniteQueryStateProp, InfiniteQueryHelpers, PrefetchLinkProp, } from "./query.prop.js";
|
package/dist/props/registry.d.ts
CHANGED
|
@@ -734,6 +734,11 @@ export declare const COMPONENT_PROP_REGISTRY: {
|
|
|
734
734
|
readonly file: "components/data-display.prop.ts";
|
|
735
735
|
readonly vocabulary: readonly ["LabelProp", "SizeProp", "ToneProp", "OnValueChangeProp", "HandlerProp", "ClassNameProp", "IdProp"];
|
|
736
736
|
};
|
|
737
|
+
readonly QrCodeProp: {
|
|
738
|
+
readonly group: "data-display";
|
|
739
|
+
readonly file: "components/data-display.prop.ts";
|
|
740
|
+
readonly vocabulary: readonly ["ValueProp", "LabelProp", "SizeProp", "ClassNameProp", "IdProp"];
|
|
741
|
+
};
|
|
737
742
|
readonly ChartSeriesProp: {
|
|
738
743
|
readonly group: "data-display";
|
|
739
744
|
readonly file: "components/charts.prop.ts";
|
package/dist/props/registry.js
CHANGED
|
@@ -810,6 +810,11 @@ const COMPONENT_PROP_REGISTRY = {
|
|
|
810
810
|
"IdProp"
|
|
811
811
|
]
|
|
812
812
|
},
|
|
813
|
+
QrCodeProp: {
|
|
814
|
+
group: "data-display",
|
|
815
|
+
file: "components/data-display.prop.ts",
|
|
816
|
+
vocabulary: ["ValueProp", "LabelProp", "SizeProp", "ClassNameProp", "IdProp"]
|
|
817
|
+
},
|
|
813
818
|
ChartSeriesProp: {
|
|
814
819
|
group: "data-display",
|
|
815
820
|
file: "components/charts.prop.ts",
|
|
@@ -534,4 +534,23 @@
|
|
|
534
534
|
display: flex;
|
|
535
535
|
justify-content: flex-end;
|
|
536
536
|
}
|
|
537
|
+
|
|
538
|
+
/* QrCode — a quiet, scanner-safe SVG surface with an ISO/IEC-style four-module quiet zone
|
|
539
|
+
* supplied by the encoder. Sizing is natural rather than stretched across its container. */
|
|
540
|
+
.ui-qr-code {
|
|
541
|
+
display: block;
|
|
542
|
+
inline-size: var(--qr-code-size-md);
|
|
543
|
+
block-size: auto;
|
|
544
|
+
max-inline-size: 100%;
|
|
545
|
+
aspect-ratio: 1;
|
|
546
|
+
}
|
|
547
|
+
.ui-qr-code[data-size="xs"] {
|
|
548
|
+
inline-size: var(--qr-code-size-xs);
|
|
549
|
+
}
|
|
550
|
+
.ui-qr-code[data-size="sm"] {
|
|
551
|
+
inline-size: var(--qr-code-size-sm);
|
|
552
|
+
}
|
|
553
|
+
.ui-qr-code[data-size="lg"] {
|
|
554
|
+
inline-size: var(--qr-code-size-lg);
|
|
555
|
+
}
|
|
537
556
|
}
|
|
@@ -31,4 +31,13 @@
|
|
|
31
31
|
re-resolves under a scoped theme. Defaults = hsl(var(--primary) / 0.3) border · 0.05 fill. */
|
|
32
32
|
--tree-item-active-border: initial;
|
|
33
33
|
--tree-item-active-background: initial;
|
|
34
|
+
|
|
35
|
+
/* QR codes stay scanner-safe in light and dark application themes. Consumers may override these
|
|
36
|
+
component tokens only when the resulting pair retains strong contrast. */
|
|
37
|
+
--qr-code-foreground: 0 0% 0%;
|
|
38
|
+
--qr-code-background: 0 0% 100%;
|
|
39
|
+
--qr-code-size-xs: 6rem;
|
|
40
|
+
--qr-code-size-sm: 8rem;
|
|
41
|
+
--qr-code-size-md: 10rem;
|
|
42
|
+
--qr-code-size-lg: 12.5rem;
|
|
34
43
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@godxjp/ui",
|
|
3
|
-
"version": "18.
|
|
4
|
-
"godxUiMcp": "18.
|
|
3
|
+
"version": "18.3.0",
|
|
4
|
+
"godxUiMcp": "18.3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.29.1",
|
|
7
7
|
"pnpm": {
|
|
@@ -410,6 +410,7 @@
|
|
|
410
410
|
"embla-carousel-react": "^8.6.0",
|
|
411
411
|
"input-otp": "^1.4.2",
|
|
412
412
|
"lucide-react": "^1.25.0",
|
|
413
|
+
"qrcode.react": "4.2.0",
|
|
413
414
|
"react-day-picker": "^10.0.1",
|
|
414
415
|
"react-resizable-panels": "^4.12.2",
|
|
415
416
|
"sonner": "^2.0.7",
|
|
@@ -427,6 +428,7 @@
|
|
|
427
428
|
"@testing-library/react": "^16.3.2",
|
|
428
429
|
"@testing-library/user-event": "^14.6.1",
|
|
429
430
|
"@types/node": "^22.19.19",
|
|
431
|
+
"@types/pngjs": "^6.0.5",
|
|
430
432
|
"@types/react": "^19.2.17",
|
|
431
433
|
"@types/react-dom": "^19.2.3",
|
|
432
434
|
"@vitejs/plugin-react": "^6.0.3",
|
|
@@ -437,7 +439,9 @@
|
|
|
437
439
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
438
440
|
"globals": "^15.15.0",
|
|
439
441
|
"jsdom": "^29.1.1",
|
|
442
|
+
"jsqr": "^1.4.0",
|
|
440
443
|
"playwright": "^1.61.1",
|
|
444
|
+
"pngjs": "^7.0.0",
|
|
441
445
|
"prettier": "^3.9.5",
|
|
442
446
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
443
447
|
"react": "^19.2.7",
|