@diwacopilot/components-react 1.2.2 → 1.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/dist/index.d.ts CHANGED
@@ -1,6 +1,60 @@
1
1
  export * from './components';
2
+ export { DiwaAccordion as DAccordion } from './components';
2
3
  export { DiwaBadge as DBadge } from './components';
3
4
  export { DiwaButton as DButton } from './components';
5
+ export { DiwaButtonPure as DButtonPure } from './components';
6
+ export { DiwaCheckbox as DCheckbox } from './components';
7
+ export { DiwaDivider as DDivider } from './components';
8
+ export { DiwaFlyout as DFlyout } from './components';
9
+ export { DiwaHeading as DHeading } from './components';
10
+ export { DiwaIcon as DIcon } from './components';
11
+ export { DiwaInlineNotification as DInlineNotification } from './components';
4
12
  export { DiwaInput as DInput } from './components';
13
+ export { DiwaInputDate as DInputDate } from './components';
14
+ export { DiwaInputEmail as DInputEmail } from './components';
15
+ export { DiwaInputMonth as DInputMonth } from './components';
16
+ export { DiwaInputNumber as DInputNumber } from './components';
17
+ export { DiwaInputPassword as DInputPassword } from './components';
18
+ export { DiwaInputSearch as DInputSearch } from './components';
19
+ export { DiwaInputTel as DInputTel } from './components';
20
+ export { DiwaInputText as DInputText } from './components';
21
+ export { DiwaInputTime as DInputTime } from './components';
22
+ export { DiwaInputUrl as DInputUrl } from './components';
23
+ export { DiwaInputWeek as DInputWeek } from './components';
24
+ export { DiwaLink as DLink } from './components';
25
+ export { DiwaLinkPure as DLinkPure } from './components';
26
+ export { DiwaModal as DModal } from './components';
27
+ export { DiwaMultiSelect as DMultiSelect } from './components';
28
+ export { DiwaMultiSelectOption as DMultiSelectOption } from './components';
29
+ export { DiwaPagination as DPagination } from './components';
30
+ export { DiwaPinCode as DPinCode } from './components';
31
+ export { DiwaPopover as DPopover } from './components';
32
+ export { DiwaRadioGroup as DRadioGroup } from './components';
33
+ export { DiwaRadioGroupItem as DRadioGroupItem } from './components';
34
+ export { DiwaScroller as DScroller } from './components';
35
+ export { DiwaSegmentedControl as DSegmentedControl } from './components';
36
+ export { DiwaSegmentedControlItem as DSegmentedControlItem } from './components';
37
+ export { DiwaSelect as DSelect } from './components';
38
+ export { DiwaSelectOption as DSelectOption } from './components';
5
39
  export { DiwaSpinner as DSpinner } from './components';
40
+ export { DiwaStepperHorizontal as DStepperHorizontal } from './components';
41
+ export { DiwaStepperHorizontalItem as DStepperHorizontalItem } from './components';
42
+ export { DiwaSwitch as DSwitch } from './components';
43
+ export { DiwaTable as DTable } from './components';
44
+ export { DiwaTableBody as DTableBody } from './components';
45
+ export { DiwaTableCell as DTableCell } from './components';
46
+ export { DiwaTableHead as DTableHead } from './components';
47
+ export { DiwaTableHeadCell as DTableHeadCell } from './components';
48
+ export { DiwaTableRow as DTableRow } from './components';
49
+ export { DiwaTabs as DTabs } from './components';
50
+ export { DiwaTabsBar as DTabsBar } from './components';
51
+ export { DiwaTabsItem as DTabsItem } from './components';
52
+ export { DiwaTag as DTag } from './components';
53
+ export { DiwaTagDismissible as DTagDismissible } from './components';
54
+ export { DiwaText as DText } from './components';
55
+ export { DiwaTextarea as DTextarea } from './components';
56
+ export { DiwaTextList as DTextList } from './components';
57
+ export { DiwaTextListItem as DTextListItem } from './components';
58
+ export { DiwaToast as DToast } from './components';
59
+ export { DiwaToastItem as DToastItem } from './components';
6
60
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAI7B,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,WAAW,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/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4
  // The Diwa* variants remain available for backwards compatibility.
5
+ export { DiwaAccordion as DAccordion } from './components';
5
6
  export { DiwaBadge as DBadge } from './components';
6
7
  export { DiwaButton as DButton } from './components';
8
+ export { DiwaButtonPure as DButtonPure } from './components';
9
+ export { DiwaCheckbox as DCheckbox } from './components';
10
+ export { DiwaDivider as DDivider } from './components';
11
+ export { DiwaFlyout as DFlyout } from './components';
12
+ export { DiwaHeading as DHeading } from './components';
13
+ export { DiwaIcon as DIcon } from './components';
14
+ export { DiwaInlineNotification as DInlineNotification } from './components';
7
15
  export { DiwaInput as DInput } from './components';
16
+ export { DiwaInputDate as DInputDate } from './components';
17
+ export { DiwaInputEmail as DInputEmail } from './components';
18
+ export { DiwaInputMonth as DInputMonth } from './components';
19
+ export { DiwaInputNumber as DInputNumber } from './components';
20
+ export { DiwaInputPassword as DInputPassword } from './components';
21
+ export { DiwaInputSearch as DInputSearch } from './components';
22
+ export { DiwaInputTel as DInputTel } from './components';
23
+ export { DiwaInputText as DInputText } from './components';
24
+ export { DiwaInputTime as DInputTime } from './components';
25
+ export { DiwaInputUrl as DInputUrl } from './components';
26
+ export { DiwaInputWeek as DInputWeek } from './components';
27
+ export { DiwaLink as DLink } from './components';
28
+ export { DiwaLinkPure as DLinkPure } from './components';
29
+ export { DiwaModal as DModal } from './components';
30
+ export { DiwaMultiSelect as DMultiSelect } from './components';
31
+ export { DiwaMultiSelectOption as DMultiSelectOption } from './components';
32
+ export { DiwaPagination as DPagination } from './components';
33
+ export { DiwaPinCode as DPinCode } from './components';
34
+ export { DiwaPopover as DPopover } from './components';
35
+ export { DiwaRadioGroup as DRadioGroup } from './components';
36
+ export { DiwaRadioGroupItem as DRadioGroupItem } from './components';
37
+ export { DiwaScroller as DScroller } from './components';
38
+ export { DiwaSegmentedControl as DSegmentedControl } from './components';
39
+ export { DiwaSegmentedControlItem as DSegmentedControlItem } from './components';
40
+ export { DiwaSelect as DSelect } from './components';
41
+ export { DiwaSelectOption as DSelectOption } from './components';
8
42
  export { DiwaSpinner as DSpinner } from './components';
43
+ export { DiwaStepperHorizontal as DStepperHorizontal } from './components';
44
+ export { DiwaStepperHorizontalItem as DStepperHorizontalItem } from './components';
45
+ export { DiwaSwitch as DSwitch } from './components';
46
+ export { DiwaTable as DTable } from './components';
47
+ export { DiwaTableBody as DTableBody } from './components';
48
+ export { DiwaTableCell as DTableCell } from './components';
49
+ export { DiwaTableHead as DTableHead } from './components';
50
+ export { DiwaTableHeadCell as DTableHeadCell } from './components';
51
+ export { DiwaTableRow as DTableRow } from './components';
52
+ export { DiwaTabs as DTabs } from './components';
53
+ export { DiwaTabsBar as DTabsBar } from './components';
54
+ export { DiwaTabsItem as DTabsItem } from './components';
55
+ export { DiwaTag as DTag } from './components';
56
+ export { DiwaTagDismissible as DTagDismissible } from './components';
57
+ export { DiwaText as DText } from './components';
58
+ export { DiwaTextarea as DTextarea } from './components';
59
+ export { DiwaTextList as DTextList } from './components';
60
+ export { DiwaTextListItem as DTextListItem } from './components';
61
+ export { DiwaToast as DToast } from './components';
62
+ export { DiwaToastItem as DToastItem } from './components';
@@ -0,0 +1,91 @@
1
+ /**
2
+ * @diwacopilot/components-react/server
3
+ *
4
+ * RSC-safe (React Server Component-safe) exports.
5
+ *
6
+ * These are pure function components that render Diwa custom element shells as
7
+ * plain HTML attributes. They do NOT import `createReactComponent`, do NOT call
8
+ * `defineCustomElements()`, and do NOT extend React.Component — so they are safe
9
+ * to import in Next.js Server Components (and any other RSC-compatible runtime).
10
+ *
11
+ * On the server they produce the correct HTML skeleton; the browser upgrades the
12
+ * custom elements and attaches shadow DOM once the Stencil bundle loads.
13
+ *
14
+ * Supported components (presentational / no event delegation or refs needed):
15
+ * DHeading, DText, DDivider, DBadge, DIcon
16
+ *
17
+ * Interactive components (DButton, DInput*, DModal, DFlyout, …) are intentionally
18
+ * excluded — they rely on refs, DOM event delegation, and the custom element
19
+ * registry. Import them from '@diwacopilot/components-react' inside a 'use client'
20
+ * file as before.
21
+ */
22
+ import React from 'react';
23
+ type Theme = 'light' | 'dark';
24
+ export type HeadingSize = 'display' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'inherit';
25
+ export type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
26
+ export type HeadingAlign = 'start' | 'center' | 'end';
27
+ export type HeadingColor = 'primary' | 'secondary' | 'inherit';
28
+ export type HeadingWeight = 'semibold' | 'bold';
29
+ export interface DHeadingProps {
30
+ size?: HeadingSize;
31
+ tag?: HeadingTag;
32
+ weight?: HeadingWeight;
33
+ align?: HeadingAlign;
34
+ color?: HeadingColor;
35
+ theme?: Theme;
36
+ className?: string;
37
+ style?: React.CSSProperties;
38
+ children?: React.ReactNode;
39
+ }
40
+ export declare function DHeading({ size, tag, weight, align, color, theme, className, style, children, }: DHeadingProps): React.DOMElement<Record<string, unknown>, Element>;
41
+ export type TextTag = 'p' | 'span' | 'div' | 'label' | 'li';
42
+ export type TextSize = 'x-small' | 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';
43
+ export type TextWeight = 'regular' | 'semibold' | 'bold';
44
+ export type TextAlign = 'start' | 'center' | 'end';
45
+ export type TextColor = 'primary' | 'secondary' | 'tertiary' | 'inherit';
46
+ export interface DTextProps {
47
+ tag?: TextTag;
48
+ size?: TextSize;
49
+ weight?: TextWeight;
50
+ align?: TextAlign;
51
+ color?: TextColor;
52
+ ellipsis?: boolean;
53
+ theme?: Theme;
54
+ className?: string;
55
+ style?: React.CSSProperties;
56
+ children?: React.ReactNode;
57
+ }
58
+ export declare function DText({ tag, size, weight, align, color, ellipsis, theme, className, style, children, }: DTextProps): React.DOMElement<Record<string, unknown>, Element>;
59
+ export type DividerOrientation = 'horizontal' | 'vertical';
60
+ export interface DDividerProps {
61
+ orientation?: DividerOrientation;
62
+ theme?: Theme;
63
+ className?: string;
64
+ style?: React.CSSProperties;
65
+ }
66
+ export declare function DDivider({ orientation, theme, className, style, }: DDividerProps): React.DOMElement<Record<string, unknown>, Element>;
67
+ export type BadgeVariant = 'neutral' | 'accent' | 'success' | 'warning' | 'danger';
68
+ export type BadgeSize = 'sm' | 'md';
69
+ export interface DBadgeProps {
70
+ variant?: BadgeVariant;
71
+ size?: BadgeSize;
72
+ label?: string;
73
+ dot?: boolean;
74
+ theme?: Theme;
75
+ className?: string;
76
+ style?: React.CSSProperties;
77
+ children?: React.ReactNode;
78
+ }
79
+ export declare function DBadge({ variant, size, label, dot, theme, className, style, children, }: DBadgeProps): React.DOMElement<Record<string, unknown>, Element>;
80
+ export interface DIconProps {
81
+ name: string;
82
+ size?: number;
83
+ color?: string;
84
+ label?: string;
85
+ theme?: Theme;
86
+ className?: string;
87
+ style?: React.CSSProperties;
88
+ }
89
+ export declare function DIcon({ name, size, color, label, theme, className, style, }: DIconProps): React.DOMElement<Record<string, unknown>, Element>;
90
+ export {};
91
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAI9B,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;AAC1F,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AACzE,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AACtD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;AAC/D,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,MAAM,CAAC;AAEhD,MAAM,WAAW,aAAa;IAC5B,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AAW,sDAab;AASD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,KAAK,CAAC,EACpB,IAAI,EACJ,IAAS,EACT,KAAsB,EACtB,KAAK,EACL,KAAc,EACd,SAAS,EACT,KAAK,GACN,EAAE,UAAU,sDAaZ"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * @diwacopilot/components-react/server
3
+ *
4
+ * RSC-safe (React Server Component-safe) exports.
5
+ *
6
+ * These are pure function components that render Diwa custom element shells as
7
+ * plain HTML attributes. They do NOT import `createReactComponent`, do NOT call
8
+ * `defineCustomElements()`, and do NOT extend React.Component — so they are safe
9
+ * to import in Next.js Server Components (and any other RSC-compatible runtime).
10
+ *
11
+ * On the server they produce the correct HTML skeleton; the browser upgrades the
12
+ * custom elements and attaches shadow DOM once the Stencil bundle loads.
13
+ *
14
+ * Supported components (presentational / no event delegation or refs needed):
15
+ * DHeading, DText, DDivider, DBadge, DIcon
16
+ *
17
+ * Interactive components (DButton, DInput*, DModal, DFlyout, …) are intentionally
18
+ * excluded — they rely on refs, DOM event delegation, and the custom element
19
+ * registry. Import them from '@diwacopilot/components-react' inside a 'use client'
20
+ * file as before.
21
+ */
22
+ import React from 'react';
23
+ export function DHeading({ size = 'h2', tag, weight = 'bold', align = 'start', color = 'primary', theme = 'dark', className, style, children, }) {
24
+ const props = {
25
+ size,
26
+ weight,
27
+ align,
28
+ color,
29
+ theme,
30
+ suppressHydrationWarning: true,
31
+ };
32
+ if (tag !== undefined)
33
+ props['tag'] = tag;
34
+ if (className !== undefined)
35
+ props['class'] = className;
36
+ if (style !== undefined)
37
+ props['style'] = style;
38
+ return React.createElement('diwa-heading', props, children);
39
+ }
40
+ export function DText({ tag = 'p', size = 'small', weight = 'regular', align = 'start', color = 'primary', ellipsis = false, theme = 'dark', className, style, children, }) {
41
+ const props = {
42
+ tag,
43
+ size,
44
+ weight,
45
+ align,
46
+ color,
47
+ theme,
48
+ suppressHydrationWarning: true,
49
+ };
50
+ if (ellipsis)
51
+ props['ellipsis'] = true;
52
+ if (className !== undefined)
53
+ props['class'] = className;
54
+ if (style !== undefined)
55
+ props['style'] = style;
56
+ return React.createElement('diwa-text', props, children);
57
+ }
58
+ export function DDivider({ orientation = 'horizontal', theme = 'dark', className, style, }) {
59
+ const props = {
60
+ orientation,
61
+ theme,
62
+ suppressHydrationWarning: true,
63
+ };
64
+ if (className !== undefined)
65
+ props['class'] = className;
66
+ if (style !== undefined)
67
+ props['style'] = style;
68
+ return React.createElement('diwa-divider', props);
69
+ }
70
+ export function DBadge({ variant = 'neutral', size = 'md', label, dot = false, theme = 'dark', className, style, children, }) {
71
+ const props = {
72
+ variant,
73
+ size,
74
+ theme,
75
+ suppressHydrationWarning: true,
76
+ };
77
+ if (dot)
78
+ props['dot'] = true;
79
+ if (label !== undefined)
80
+ props['label'] = label;
81
+ if (className !== undefined)
82
+ props['class'] = className;
83
+ if (style !== undefined)
84
+ props['style'] = style;
85
+ return React.createElement('diwa-badge', props, children);
86
+ }
87
+ export function DIcon({ name, size = 24, color = 'currentColor', label, theme = 'dark', className, style, }) {
88
+ const props = {
89
+ name,
90
+ size,
91
+ color,
92
+ theme,
93
+ suppressHydrationWarning: true,
94
+ };
95
+ if (label !== undefined)
96
+ props['label'] = label;
97
+ if (className !== undefined)
98
+ props['class'] = className;
99
+ if (style !== undefined)
100
+ props['style'] = style;
101
+ return React.createElement('diwa-icon', props);
102
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diwacopilot/components-react",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "React wrapper package for Diwa Web Components.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,6 +14,10 @@
14
14
  ".": {
15
15
  "types": "./dist/index.d.ts",
16
16
  "import": "./dist/index.js"
17
+ },
18
+ "./server": {
19
+ "types": "./dist/server/index.d.ts",
20
+ "import": "./dist/server/index.js"
17
21
  }
18
22
  },
19
23
  "scripts": {