@proto.ui/prototypes-shadcn 0.2.0-rc.5 → 0.2.0-rc.7
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 +3 -1
- package/dist/button/button.proto.d.ts +2 -2
- package/dist/button/index.d.ts +2 -2
- package/dist/button/index.js +1 -1
- package/dist/component-presets.d.ts +35 -0
- package/dist/component-presets.js +16 -0
- package/dist/component-presets.types.d.ts +10 -0
- package/dist/component-presets.types.js +1 -0
- package/dist/dialog/close-icon.proto.d.ts +1 -1
- package/dist/dialog/close-icon.proto.js +3 -3
- package/dist/dialog/close.proto.d.ts +1 -1
- package/dist/dialog/content.proto.d.ts +1 -1
- package/dist/dialog/description.proto.d.ts +1 -1
- package/dist/dialog/index.d.ts +22 -21
- package/dist/dialog/index.js +21 -20
- package/dist/dialog/overlay.proto.d.ts +1 -1
- package/dist/dialog/preset.d.ts +15 -0
- package/dist/dialog/preset.js +15 -0
- package/dist/dialog/root.proto.d.ts +1 -1
- package/dist/dialog/title.proto.d.ts +1 -1
- package/dist/dialog/trigger.proto.d.ts +2 -3
- package/dist/dialog/trigger.proto.js +5 -110
- package/dist/dialog/types.d.ts +1 -3
- package/dist/dropdown/content.proto.d.ts +1 -1
- package/dist/dropdown/index.d.ts +9 -9
- package/dist/dropdown/index.js +8 -8
- package/dist/dropdown/item.proto.d.ts +2 -2
- package/dist/dropdown/root.proto.d.ts +1 -1
- package/dist/dropdown/trigger.proto.d.ts +2 -2
- package/dist/hover-card/content.proto.d.ts +1 -1
- package/dist/hover-card/index.d.ts +7 -7
- package/dist/hover-card/index.js +6 -6
- package/dist/hover-card/root.proto.d.ts +1 -1
- package/dist/hover-card/trigger.proto.d.ts +1 -1
- package/dist/index.d.ts +47 -46
- package/dist/index.js +39 -38
- package/dist/select/content.proto.d.ts +2 -2
- package/dist/select/index.d.ts +11 -11
- package/dist/select/index.js +10 -10
- package/dist/select/item.proto.d.ts +1 -1
- package/dist/select/root.proto.d.ts +1 -1
- package/dist/select/trigger.proto.d.ts +2 -2
- package/dist/select/value.proto.d.ts +1 -1
- package/dist/switch/index.d.ts +6 -5
- package/dist/switch/index.js +5 -4
- package/dist/switch/preset.d.ts +15 -0
- package/dist/switch/preset.js +15 -0
- package/dist/switch/root.proto.d.ts +2 -2
- package/dist/switch/thumb.proto.d.ts +2 -2
- package/dist/switch/thumb.proto.js +2 -1
- package/dist/tabs/content.proto.d.ts +2 -2
- package/dist/tabs/content.proto.js +1 -1
- package/dist/tabs/index.d.ts +9 -9
- package/dist/tabs/index.js +8 -8
- package/dist/tabs/list.proto.d.ts +2 -2
- package/dist/tabs/list.proto.js +1 -1
- package/dist/tabs/root.proto.d.ts +2 -2
- package/dist/tabs/root.proto.js +1 -1
- package/dist/tabs/trigger.proto.d.ts +2 -2
- package/dist/tabs/trigger.proto.js +12 -12
- package/dist/toggle/index.d.ts +2 -2
- package/dist/toggle/index.js +1 -1
- package/dist/toggle/toggle.proto.d.ts +3 -3
- package/package.json +17 -3
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Prototype library package intended to be consumed together with Proto UI adapter
|
|
|
22
22
|
## Install
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
npm install @proto.ui/prototypes-shadcn@0.2.0-rc.
|
|
25
|
+
npm install @proto.ui/prototypes-shadcn@0.2.0-rc.7
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
## Family Imports
|
|
@@ -39,6 +39,8 @@ The root package export remains available for compatibility. Shadcn families do
|
|
|
39
39
|
## Internal Structure
|
|
40
40
|
|
|
41
41
|
- `src/button/`
|
|
42
|
+
- `src/component-presets.ts`
|
|
43
|
+
- `src/component-presets.types.ts`
|
|
42
44
|
- `src/dialog/`
|
|
43
45
|
- `src/dropdown/`
|
|
44
46
|
- `src/hover-card/`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ShadcnButtonExposes, ShadcnButtonProps, ShadcnButtonSize, ShadcnButtonVariant } from './types';
|
|
2
|
-
declare const button: import("@proto.ui/core").Prototype<ShadcnButtonProps, import("@proto.ui/prototypes-base
|
|
1
|
+
import type { ShadcnButtonExposes, ShadcnButtonProps, ShadcnButtonSize, ShadcnButtonVariant } from './types.js';
|
|
2
|
+
declare const button: import("@proto.ui/core").Prototype<ShadcnButtonProps, import("@proto.ui/prototypes-base").ButtonExposes>;
|
|
3
3
|
/**
|
|
4
4
|
* P-SHADCN-BUTTON-COMPATIBILITY-SUBSET:
|
|
5
5
|
* The one catalog open question centralizes every upstream difference.
|
package/dist/button/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default, default as shadcnButton } from './button.proto';
|
|
2
|
-
export type { ShadcnButtonExposes, ShadcnButtonProps, ShadcnButtonSize, ShadcnButtonVariant, } from './button.proto';
|
|
1
|
+
export { default, default as shadcnButton } from './button.proto.js';
|
|
2
|
+
export type { ShadcnButtonExposes, ShadcnButtonProps, ShadcnButtonSize, ShadcnButtonVariant, } from './button.proto.js';
|
package/dist/button/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default, default as shadcnButton } from './button.proto';
|
|
1
|
+
export { default, default as shadcnButton } from './button.proto.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { shadcnDialogComponentPreset } from './dialog/preset.js';
|
|
2
|
+
import { shadcnSwitchComponentPreset } from './switch/preset.js';
|
|
3
|
+
export type { ShadcnComponentPresetRecipe } from './component-presets.types.js';
|
|
4
|
+
export { shadcnDialogComponentPreset, shadcnSwitchComponentPreset };
|
|
5
|
+
/**
|
|
6
|
+
* Aggregate surface for prototype-library-owned composition recipes.
|
|
7
|
+
*
|
|
8
|
+
* Each recipe is authored beside its component prototypes. Recipes declare
|
|
9
|
+
* part identity and replacement policy only. Host facade names for the
|
|
10
|
+
* referenced prototypes remain adapter/CLI registry concerns, and all visual
|
|
11
|
+
* tokens remain owned by the referenced prototypes.
|
|
12
|
+
*/
|
|
13
|
+
export declare const shadcnComponentPresets: {
|
|
14
|
+
readonly 'shadcn-switch': {
|
|
15
|
+
readonly kind: "replaceable-default-part";
|
|
16
|
+
readonly placement: "direct-child";
|
|
17
|
+
readonly exportName: "ShadcnSwitch";
|
|
18
|
+
readonly rootPrototype: "shadcnSwitchRoot";
|
|
19
|
+
readonly defaultPartPrototype: "shadcnSwitchThumb";
|
|
20
|
+
readonly inputName: "thumb";
|
|
21
|
+
readonly elementName: "proto-ui-shadcn-switch";
|
|
22
|
+
readonly omissionAttribute: "data-pui-no-default-thumb";
|
|
23
|
+
};
|
|
24
|
+
readonly 'shadcn-dialog': {
|
|
25
|
+
readonly kind: "replaceable-default-part";
|
|
26
|
+
readonly placement: "direct-child";
|
|
27
|
+
readonly exportName: "ShadcnDialogContent";
|
|
28
|
+
readonly rootPrototype: "shadcnDialogContent";
|
|
29
|
+
readonly defaultPartPrototype: "shadcnDialogCloseIcon";
|
|
30
|
+
readonly inputName: "close";
|
|
31
|
+
readonly elementName: "proto-ui-shadcn-dialog-content";
|
|
32
|
+
readonly omissionAttribute: "data-pui-no-default-close";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export default shadcnComponentPresets;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { shadcnDialogComponentPreset } from './dialog/preset.js';
|
|
2
|
+
import { shadcnSwitchComponentPreset } from './switch/preset.js';
|
|
3
|
+
export { shadcnDialogComponentPreset, shadcnSwitchComponentPreset };
|
|
4
|
+
/**
|
|
5
|
+
* Aggregate surface for prototype-library-owned composition recipes.
|
|
6
|
+
*
|
|
7
|
+
* Each recipe is authored beside its component prototypes. Recipes declare
|
|
8
|
+
* part identity and replacement policy only. Host facade names for the
|
|
9
|
+
* referenced prototypes remain adapter/CLI registry concerns, and all visual
|
|
10
|
+
* tokens remain owned by the referenced prototypes.
|
|
11
|
+
*/
|
|
12
|
+
export const shadcnComponentPresets = {
|
|
13
|
+
'shadcn-switch': shadcnSwitchComponentPreset,
|
|
14
|
+
'shadcn-dialog': shadcnDialogComponentPreset,
|
|
15
|
+
};
|
|
16
|
+
export default shadcnComponentPresets;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ShadcnComponentPresetRecipe {
|
|
2
|
+
readonly kind: 'replaceable-default-part';
|
|
3
|
+
readonly placement: 'direct-child';
|
|
4
|
+
readonly exportName: string;
|
|
5
|
+
readonly rootPrototype: string;
|
|
6
|
+
readonly defaultPartPrototype: string;
|
|
7
|
+
readonly inputName: string;
|
|
8
|
+
readonly elementName: string;
|
|
9
|
+
readonly omissionAttribute: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const dialogCloseIcon: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base
|
|
1
|
+
declare const dialogCloseIcon: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base").DialogCloseProps, import("@proto.ui/prototypes-base").DialogCloseExposes>;
|
|
2
2
|
export default dialogCloseIcon;
|
|
@@ -8,14 +8,14 @@ const dialogCloseIcon = definePrototype({
|
|
|
8
8
|
throw new Error('[shadcn-dialog-close-icon] command states are required.');
|
|
9
9
|
const { disabled, hovered, focusVisible } = state;
|
|
10
10
|
def.a11y.name('Close');
|
|
11
|
-
def.feedback.style.use(tw('absolute right-
|
|
11
|
+
def.feedback.style.use(tw('absolute right-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 transition-opacity outline-none ring-offset-0'));
|
|
12
12
|
def.rule({
|
|
13
13
|
when: (w) => w.state(hovered).eq(true),
|
|
14
|
-
intent: (i) => i.feedback.style.use(tw('
|
|
14
|
+
intent: (i) => i.feedback.style.use(tw('opacity-100')),
|
|
15
15
|
});
|
|
16
16
|
def.rule({
|
|
17
17
|
when: (w) => w.state(focusVisible).eq(true),
|
|
18
|
-
intent: (i) => i.feedback.style.use(tw('ring-
|
|
18
|
+
intent: (i) => i.feedback.style.use(tw('ring-2 ring-ring ring-offset-2 ring-offset-background')),
|
|
19
19
|
});
|
|
20
20
|
def.rule({
|
|
21
21
|
when: (w) => w.state(disabled).eq(true),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const dialogClose: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base
|
|
1
|
+
declare const dialogClose: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base").DialogCloseProps, import("@proto.ui/prototypes-base").DialogCloseExposes>;
|
|
2
2
|
/** P-SHADCN-DIALOG-CLOSE-DIRECT-ENTRY and P-SHADCN-DIALOG-CLOSE-STATE-DRIVEN-STYLES. */
|
|
3
3
|
export default dialogClose;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ShadcnDialogContentExposes, ShadcnDialogContentProps } from './types';
|
|
1
|
+
import type { ShadcnDialogContentExposes, ShadcnDialogContentProps } from './types.js';
|
|
2
2
|
declare const dialogContent: import("@proto.ui/core").Prototype<ShadcnDialogContentProps, ShadcnDialogContentExposes>;
|
|
3
3
|
/** P-SHADCN-DIALOG-CONTENT-DIRECT-ENTRY; parity is bounded by P-SHADCN-DIALOG-CONTENT-COMPATIBILITY-SUBSET. */
|
|
4
4
|
export default dialogContent;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const dialogDescription: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base
|
|
1
|
+
declare const dialogDescription: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base").DialogDescriptionProps, import("@proto.ui/prototypes-base").DialogDescriptionExposes>;
|
|
2
2
|
/** P-SHADCN-DIALOG-DESCRIPTION-DIRECT-ENTRY; parity is bounded by P-SHADCN-DIALOG-DESCRIPTION-COMPATIBILITY-SUBSET. */
|
|
3
3
|
export default dialogDescription;
|
package/dist/dialog/index.d.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import dialogClose from './close.proto';
|
|
2
|
-
import dialogContent from './content.proto';
|
|
3
|
-
import dialogCloseIcon from './close-icon.proto';
|
|
4
|
-
import dialogDescription from './description.proto';
|
|
5
|
-
import dialogMask from './overlay.proto';
|
|
6
|
-
import dialogRoot from './root.proto';
|
|
7
|
-
import dialogTitle from './title.proto';
|
|
8
|
-
import dialogTrigger from './trigger.proto';
|
|
9
|
-
import dialogHeader from './header.proto';
|
|
10
|
-
import dialogFooter from './footer.proto';
|
|
11
|
-
export type { ShadcnDialogRootProps, ShadcnDialogRootExposes, ShadcnDialogRootAsHookContract, ShadcnDialogTriggerProps, ShadcnDialogTriggerExposes, ShadcnDialogTriggerAsHookContract, ShadcnDialogMaskProps, ShadcnDialogMaskExposes, ShadcnDialogMaskAsHookContract, ShadcnDialogContentProps, ShadcnDialogContentExposes, ShadcnDialogContentAsHookContract, ShadcnDialogTitleProps, ShadcnDialogTitleExposes, ShadcnDialogTitleAsHookContract, ShadcnDialogDescriptionProps, ShadcnDialogDescriptionExposes, ShadcnDialogDescriptionAsHookContract, ShadcnDialogCloseProps, ShadcnDialogCloseExposes, ShadcnDialogCloseAsHookContract, } from './types';
|
|
1
|
+
import dialogClose from './close.proto.js';
|
|
2
|
+
import dialogContent from './content.proto.js';
|
|
3
|
+
import dialogCloseIcon from './close-icon.proto.js';
|
|
4
|
+
import dialogDescription from './description.proto.js';
|
|
5
|
+
import dialogMask from './overlay.proto.js';
|
|
6
|
+
import dialogRoot from './root.proto.js';
|
|
7
|
+
import dialogTitle from './title.proto.js';
|
|
8
|
+
import dialogTrigger from './trigger.proto.js';
|
|
9
|
+
import dialogHeader from './header.proto.js';
|
|
10
|
+
import dialogFooter from './footer.proto.js';
|
|
11
|
+
export type { ShadcnDialogRootProps, ShadcnDialogRootExposes, ShadcnDialogRootAsHookContract, ShadcnDialogTriggerProps, ShadcnDialogTriggerExposes, ShadcnDialogTriggerAsHookContract, ShadcnDialogMaskProps, ShadcnDialogMaskExposes, ShadcnDialogMaskAsHookContract, ShadcnDialogContentProps, ShadcnDialogContentExposes, ShadcnDialogContentAsHookContract, ShadcnDialogTitleProps, ShadcnDialogTitleExposes, ShadcnDialogTitleAsHookContract, ShadcnDialogDescriptionProps, ShadcnDialogDescriptionExposes, ShadcnDialogDescriptionAsHookContract, ShadcnDialogCloseProps, ShadcnDialogCloseExposes, ShadcnDialogCloseAsHookContract, } from './types.js';
|
|
12
12
|
export { dialogRoot, dialogTrigger, dialogMask, dialogContent, dialogTitle, dialogDescription, dialogClose, dialogCloseIcon, dialogHeader, dialogFooter, };
|
|
13
|
-
export { default as shadcnDialogRoot } from './root.proto';
|
|
14
|
-
export { default as shadcnDialogTrigger } from './trigger.proto';
|
|
15
|
-
export { default as shadcnDialogMask } from './overlay.proto';
|
|
16
|
-
export { default as shadcnDialogContent } from './content.proto';
|
|
17
|
-
export { default as shadcnDialogTitle } from './title.proto';
|
|
18
|
-
export { default as shadcnDialogDescription } from './description.proto';
|
|
19
|
-
export { default as shadcnDialogClose } from './close.proto';
|
|
20
|
-
export { default as shadcnDialogCloseIcon } from './close-icon.proto';
|
|
21
|
-
export { default as shadcnDialogHeader } from './header.proto';
|
|
22
|
-
export { default as shadcnDialogFooter } from './footer.proto';
|
|
13
|
+
export { default as shadcnDialogRoot } from './root.proto.js';
|
|
14
|
+
export { default as shadcnDialogTrigger } from './trigger.proto.js';
|
|
15
|
+
export { default as shadcnDialogMask } from './overlay.proto.js';
|
|
16
|
+
export { default as shadcnDialogContent } from './content.proto.js';
|
|
17
|
+
export { default as shadcnDialogTitle } from './title.proto.js';
|
|
18
|
+
export { default as shadcnDialogDescription } from './description.proto.js';
|
|
19
|
+
export { default as shadcnDialogClose } from './close.proto.js';
|
|
20
|
+
export { default as shadcnDialogCloseIcon } from './close-icon.proto.js';
|
|
21
|
+
export { default as shadcnDialogHeader } from './header.proto.js';
|
|
22
|
+
export { default as shadcnDialogFooter } from './footer.proto.js';
|
|
23
|
+
export { default as componentPreset, shadcnDialogComponentPreset } from './preset.js';
|
package/dist/dialog/index.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import dialogClose from './close.proto';
|
|
2
|
-
import dialogContent from './content.proto';
|
|
3
|
-
import dialogCloseIcon from './close-icon.proto';
|
|
4
|
-
import dialogDescription from './description.proto';
|
|
5
|
-
import dialogMask from './overlay.proto';
|
|
6
|
-
import dialogRoot from './root.proto';
|
|
7
|
-
import dialogTitle from './title.proto';
|
|
8
|
-
import dialogTrigger from './trigger.proto';
|
|
9
|
-
import dialogHeader from './header.proto';
|
|
10
|
-
import dialogFooter from './footer.proto';
|
|
1
|
+
import dialogClose from './close.proto.js';
|
|
2
|
+
import dialogContent from './content.proto.js';
|
|
3
|
+
import dialogCloseIcon from './close-icon.proto.js';
|
|
4
|
+
import dialogDescription from './description.proto.js';
|
|
5
|
+
import dialogMask from './overlay.proto.js';
|
|
6
|
+
import dialogRoot from './root.proto.js';
|
|
7
|
+
import dialogTitle from './title.proto.js';
|
|
8
|
+
import dialogTrigger from './trigger.proto.js';
|
|
9
|
+
import dialogHeader from './header.proto.js';
|
|
10
|
+
import dialogFooter from './footer.proto.js';
|
|
11
11
|
export { dialogRoot, dialogTrigger, dialogMask, dialogContent, dialogTitle, dialogDescription, dialogClose, dialogCloseIcon, dialogHeader, dialogFooter, };
|
|
12
|
-
export { default as shadcnDialogRoot } from './root.proto';
|
|
13
|
-
export { default as shadcnDialogTrigger } from './trigger.proto';
|
|
14
|
-
export { default as shadcnDialogMask } from './overlay.proto';
|
|
15
|
-
export { default as shadcnDialogContent } from './content.proto';
|
|
16
|
-
export { default as shadcnDialogTitle } from './title.proto';
|
|
17
|
-
export { default as shadcnDialogDescription } from './description.proto';
|
|
18
|
-
export { default as shadcnDialogClose } from './close.proto';
|
|
19
|
-
export { default as shadcnDialogCloseIcon } from './close-icon.proto';
|
|
20
|
-
export { default as shadcnDialogHeader } from './header.proto';
|
|
21
|
-
export { default as shadcnDialogFooter } from './footer.proto';
|
|
12
|
+
export { default as shadcnDialogRoot } from './root.proto.js';
|
|
13
|
+
export { default as shadcnDialogTrigger } from './trigger.proto.js';
|
|
14
|
+
export { default as shadcnDialogMask } from './overlay.proto.js';
|
|
15
|
+
export { default as shadcnDialogContent } from './content.proto.js';
|
|
16
|
+
export { default as shadcnDialogTitle } from './title.proto.js';
|
|
17
|
+
export { default as shadcnDialogDescription } from './description.proto.js';
|
|
18
|
+
export { default as shadcnDialogClose } from './close.proto.js';
|
|
19
|
+
export { default as shadcnDialogCloseIcon } from './close-icon.proto.js';
|
|
20
|
+
export { default as shadcnDialogHeader } from './header.proto.js';
|
|
21
|
+
export { default as shadcnDialogFooter } from './footer.proto.js';
|
|
22
|
+
export { default as componentPreset, shadcnDialogComponentPreset } from './preset.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ShadcnDialogMaskExposes, ShadcnDialogMaskProps } from './types';
|
|
1
|
+
import type { ShadcnDialogMaskExposes, ShadcnDialogMaskProps } from './types.js';
|
|
2
2
|
declare const dialogMask: import("@proto.ui/core").Prototype<ShadcnDialogMaskProps, ShadcnDialogMaskExposes>;
|
|
3
3
|
/** P-SHADCN-DIALOG-MASK-DIRECT-ENTRY; parity is bounded by P-SHADCN-DIALOG-MASK-COMPATIBILITY-SUBSET. */
|
|
4
4
|
export default dialogMask;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component-local composition recipe for the Shadcn Dialog Content convenience facade.
|
|
3
|
+
* Visual tokens remain owned by the referenced Content and CloseIcon prototypes.
|
|
4
|
+
*/
|
|
5
|
+
export declare const shadcnDialogComponentPreset: {
|
|
6
|
+
readonly kind: "replaceable-default-part";
|
|
7
|
+
readonly placement: "direct-child";
|
|
8
|
+
readonly exportName: "ShadcnDialogContent";
|
|
9
|
+
readonly rootPrototype: "shadcnDialogContent";
|
|
10
|
+
readonly defaultPartPrototype: "shadcnDialogCloseIcon";
|
|
11
|
+
readonly inputName: "close";
|
|
12
|
+
readonly elementName: "proto-ui-shadcn-dialog-content";
|
|
13
|
+
readonly omissionAttribute: "data-pui-no-default-close";
|
|
14
|
+
};
|
|
15
|
+
export default shadcnDialogComponentPreset;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component-local composition recipe for the Shadcn Dialog Content convenience facade.
|
|
3
|
+
* Visual tokens remain owned by the referenced Content and CloseIcon prototypes.
|
|
4
|
+
*/
|
|
5
|
+
export const shadcnDialogComponentPreset = {
|
|
6
|
+
kind: 'replaceable-default-part',
|
|
7
|
+
placement: 'direct-child',
|
|
8
|
+
exportName: 'ShadcnDialogContent',
|
|
9
|
+
rootPrototype: 'shadcnDialogContent',
|
|
10
|
+
defaultPartPrototype: 'shadcnDialogCloseIcon',
|
|
11
|
+
inputName: 'close',
|
|
12
|
+
elementName: 'proto-ui-shadcn-dialog-content',
|
|
13
|
+
omissionAttribute: 'data-pui-no-default-close',
|
|
14
|
+
};
|
|
15
|
+
export default shadcnDialogComponentPreset;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const dialogRoot: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base
|
|
1
|
+
declare const dialogRoot: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base").DialogRootProps, import("@proto.ui/prototypes-base").DialogRootExposes>;
|
|
2
2
|
/** P-SHADCN-DIALOG-DIRECT-ENTRY; parity is bounded by P-SHADCN-DIALOG-COMPATIBILITY-SUBSET. */
|
|
3
3
|
export default dialogRoot;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const dialogTitle: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base
|
|
1
|
+
declare const dialogTitle: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base").DialogTitleProps, import("@proto.ui/prototypes-base").DialogTitleExposes>;
|
|
2
2
|
/** P-SHADCN-DIALOG-TITLE-DIRECT-ENTRY; parity is bounded by P-SHADCN-DIALOG-TITLE-COMPATIBILITY-SUBSET. */
|
|
3
3
|
export default dialogTitle;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/** P-SHADCN-DIALOG-TRIGGER-DIRECT-ENTRY and P-SHADCN-DIALOG-TRIGGER-STATE-DRIVEN-STYLES. */
|
|
1
|
+
declare const dialogTrigger: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base").DialogTriggerProps, import("@proto.ui/prototypes-base").DialogTriggerExposes>;
|
|
2
|
+
/** P-SHADCN-DIALOG-TRIGGER-DIRECT-ENTRY and P-SHADCN-DIALOG-TRIGGER-UNSTYLED-SURFACE. */
|
|
4
3
|
export default dialogTrigger;
|
|
@@ -1,118 +1,13 @@
|
|
|
1
|
-
import { definePrototype
|
|
1
|
+
import { definePrototype } from '@proto.ui/core';
|
|
2
2
|
import { asDialogTrigger } from '@proto.ui/prototypes-base/dialog';
|
|
3
|
-
const BASE_TOKENS = [
|
|
4
|
-
'group/button',
|
|
5
|
-
'inline-flex',
|
|
6
|
-
'shrink-0',
|
|
7
|
-
'items-center',
|
|
8
|
-
'justify-center',
|
|
9
|
-
'rounded-lg',
|
|
10
|
-
'border',
|
|
11
|
-
'bg-clip-padding',
|
|
12
|
-
'text-sm',
|
|
13
|
-
'font-medium',
|
|
14
|
-
'whitespace-nowrap',
|
|
15
|
-
'transition-all',
|
|
16
|
-
'outline-none',
|
|
17
|
-
'select-none',
|
|
18
|
-
'h-8',
|
|
19
|
-
'gap-1.5',
|
|
20
|
-
'px-2.5',
|
|
21
|
-
].join(' ');
|
|
22
|
-
const VARIANT_TOKENS = {
|
|
23
|
-
default: 'border-transparent bg-primary text-primary-foreground',
|
|
24
|
-
destructive: 'border-transparent bg-destructive/10 text-destructive',
|
|
25
|
-
outline: 'border-border bg-background text-foreground',
|
|
26
|
-
secondary: 'border-transparent bg-secondary text-secondary-foreground',
|
|
27
|
-
ghost: 'border-transparent bg-transparent text-foreground',
|
|
28
|
-
link: 'border-transparent bg-transparent text-primary underline-offset-4',
|
|
29
|
-
};
|
|
30
3
|
const dialogTrigger = definePrototype({
|
|
31
4
|
name: 'shadcn-dialog-trigger',
|
|
32
|
-
setup(
|
|
33
|
-
// P-SHADCN-DIALOG-TRIGGER-VARIANT-PROP
|
|
34
|
-
def.props.define({
|
|
35
|
-
variant: {
|
|
36
|
-
type: 'enum',
|
|
37
|
-
empty: 'fallback',
|
|
38
|
-
options: ['default', 'destructive', 'outline', 'secondary', 'ghost', 'link'],
|
|
39
|
-
},
|
|
40
|
-
disabled: { type: 'boolean', empty: 'fallback' },
|
|
41
|
-
});
|
|
42
|
-
def.props.setDefaults({
|
|
43
|
-
variant: 'default',
|
|
44
|
-
disabled: false,
|
|
45
|
-
});
|
|
5
|
+
setup() {
|
|
46
6
|
// P-SHADCN-DIALOG-TRIGGER-BASE-INHERITANCE,
|
|
47
7
|
// P-SHADCN-DIALOG-TRIGGER-CURRENT-BASE-DEVIATIONS
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
throw new Error('[shadcn-dialog-trigger] Dialog Trigger must project command states.');
|
|
51
|
-
}
|
|
52
|
-
const { disabled, hovered, focusVisible, pressed } = buttonState;
|
|
53
|
-
const expanded = def.state.fromAccessibility('expanded');
|
|
54
|
-
const invalid = def.state.fromAccessibility('invalid');
|
|
55
|
-
// P-SHADCN-DIALOG-TRIGGER-CURRENT-VISUAL-SURFACE
|
|
56
|
-
def.feedback.style.use(tw(BASE_TOKENS));
|
|
57
|
-
Object.keys(VARIANT_TOKENS).forEach((variant) => {
|
|
58
|
-
def.rule({
|
|
59
|
-
when: (w) => w.prop('variant').eq(variant),
|
|
60
|
-
intent: (i) => i.feedback.style.use(tw(VARIANT_TOKENS[variant])),
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
def.rule({
|
|
64
|
-
when: (w) => w.state(focusVisible).eq(true),
|
|
65
|
-
intent: (i) => i.feedback.style.use(tw('border-ring ring-3 ring-ring/50')),
|
|
66
|
-
});
|
|
67
|
-
def.rule({
|
|
68
|
-
when: (w) => w.all(w.state(focusVisible).eq(true), w.prop('variant').eq('destructive')),
|
|
69
|
-
intent: (i) => i.feedback.style.use(tw('border-destructive/40 ring-destructive/20')),
|
|
70
|
-
});
|
|
71
|
-
def.rule({
|
|
72
|
-
when: (w) => w.state(pressed).eq(true),
|
|
73
|
-
intent: (i) => i.feedback.style.use(tw('translate-y-px')),
|
|
74
|
-
});
|
|
75
|
-
def.rule({
|
|
76
|
-
when: (w) => w.all(w.state(hovered).eq(true), w.prop('variant').eq('default')),
|
|
77
|
-
intent: (i) => i.feedback.style.use(tw('bg-primary/80')),
|
|
78
|
-
});
|
|
79
|
-
def.rule({
|
|
80
|
-
when: (w) => w.all(w.state(hovered).eq(true), w.prop('variant').eq('secondary')),
|
|
81
|
-
intent: (i) => i.feedback.style.use(tw('bg-secondary/80')),
|
|
82
|
-
});
|
|
83
|
-
def.rule({
|
|
84
|
-
when: (w) => w.all(w.state(hovered).eq(true), w.prop('variant').eq('outline')),
|
|
85
|
-
intent: (i) => i.feedback.style.use(tw('bg-muted text-foreground')),
|
|
86
|
-
});
|
|
87
|
-
def.rule({
|
|
88
|
-
when: (w) => w.all(w.state(hovered).eq(true), w.prop('variant').eq('ghost')),
|
|
89
|
-
intent: (i) => i.feedback.style.use(tw('bg-muted text-foreground')),
|
|
90
|
-
});
|
|
91
|
-
def.rule({
|
|
92
|
-
when: (w) => w.all(w.state(hovered).eq(true), w.prop('variant').eq('link')),
|
|
93
|
-
intent: (i) => i.feedback.style.use(tw('underline')),
|
|
94
|
-
});
|
|
95
|
-
def.rule({
|
|
96
|
-
when: (w) => w.all(w.state(hovered).eq(true), w.prop('variant').eq('destructive')),
|
|
97
|
-
intent: (i) => i.feedback.style.use(tw('bg-destructive/20')),
|
|
98
|
-
});
|
|
99
|
-
def.rule({
|
|
100
|
-
when: (w) => w.all(w.state(expanded).eq(true), w.prop('variant').eq('outline')),
|
|
101
|
-
intent: (i) => i.feedback.style.use(tw('bg-muted text-foreground')),
|
|
102
|
-
});
|
|
103
|
-
def.rule({
|
|
104
|
-
when: (w) => w.all(w.state(expanded).eq(true), w.prop('variant').eq('secondary')),
|
|
105
|
-
intent: (i) => i.feedback.style.use(tw('bg-secondary text-secondary-foreground')),
|
|
106
|
-
});
|
|
107
|
-
def.rule({
|
|
108
|
-
when: (w) => w.state(invalid).eq(true),
|
|
109
|
-
intent: (i) => i.feedback.style.use(tw('border-destructive ring-3 ring-destructive/20')),
|
|
110
|
-
});
|
|
111
|
-
def.rule({
|
|
112
|
-
when: (w) => w.state(disabled).eq(true),
|
|
113
|
-
intent: (i) => i.feedback.style.use(tw('pointer-events-none opacity-50')),
|
|
114
|
-
});
|
|
8
|
+
// P-SHADCN-DIALOG-TRIGGER-UNSTYLED-SURFACE
|
|
9
|
+
asDialogTrigger();
|
|
115
10
|
},
|
|
116
11
|
});
|
|
117
|
-
/** P-SHADCN-DIALOG-TRIGGER-DIRECT-ENTRY and P-SHADCN-DIALOG-TRIGGER-
|
|
12
|
+
/** P-SHADCN-DIALOG-TRIGGER-DIRECT-ENTRY and P-SHADCN-DIALOG-TRIGGER-UNSTYLED-SURFACE. */
|
|
118
13
|
export default dialogTrigger;
|
package/dist/dialog/types.d.ts
CHANGED
|
@@ -2,9 +2,7 @@ import type { DialogCloseAsHookContract, DialogCloseExposes, DialogCloseProps, D
|
|
|
2
2
|
export type ShadcnDialogRootProps = DialogRootProps;
|
|
3
3
|
export type ShadcnDialogRootExposes = DialogRootExposes;
|
|
4
4
|
export type ShadcnDialogRootAsHookContract = DialogRootAsHookContract;
|
|
5
|
-
export type ShadcnDialogTriggerProps = DialogTriggerProps
|
|
6
|
-
variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
|
7
|
-
};
|
|
5
|
+
export type ShadcnDialogTriggerProps = DialogTriggerProps;
|
|
8
6
|
export type ShadcnDialogTriggerExposes = DialogTriggerExposes;
|
|
9
7
|
export type ShadcnDialogTriggerAsHookContract = DialogTriggerAsHookContract;
|
|
10
8
|
export type ShadcnDialogMaskProps = Pick<DialogMaskProps, 'passthrough'>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const dropdownContent: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base
|
|
1
|
+
declare const dropdownContent: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base").DropdownContentProps, import("@proto.ui/prototypes-base").DropdownContentExposes>;
|
|
2
2
|
/** P-SHADCN-DROPDOWN-MENU-CONTENT-DIRECT-ENTRY; parity is bounded by P-SHADCN-DROPDOWN-MENU-CONTENT-COMPATIBILITY-SUBSET. */
|
|
3
3
|
export default dropdownContent;
|
package/dist/dropdown/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import dropdownContent from './content.proto';
|
|
2
|
-
import dropdownItem from './item.proto';
|
|
3
|
-
import dropdownRoot from './root.proto';
|
|
4
|
-
import dropdownTrigger from './trigger.proto';
|
|
5
|
-
export type { ShadcnDropdownRootProps, ShadcnDropdownRootExposes, ShadcnDropdownRootAsHookContract, ShadcnDropdownTriggerProps, ShadcnDropdownTriggerExposes, ShadcnDropdownTriggerAsHookContract, ShadcnDropdownContentProps, ShadcnDropdownContentExposes, ShadcnDropdownContentAsHookContract, ShadcnDropdownItemProps, ShadcnDropdownItemExposes, ShadcnDropdownItemAsHookContract, } from './types';
|
|
1
|
+
import dropdownContent from './content.proto.js';
|
|
2
|
+
import dropdownItem from './item.proto.js';
|
|
3
|
+
import dropdownRoot from './root.proto.js';
|
|
4
|
+
import dropdownTrigger from './trigger.proto.js';
|
|
5
|
+
export type { ShadcnDropdownRootProps, ShadcnDropdownRootExposes, ShadcnDropdownRootAsHookContract, ShadcnDropdownTriggerProps, ShadcnDropdownTriggerExposes, ShadcnDropdownTriggerAsHookContract, ShadcnDropdownContentProps, ShadcnDropdownContentExposes, ShadcnDropdownContentAsHookContract, ShadcnDropdownItemProps, ShadcnDropdownItemExposes, ShadcnDropdownItemAsHookContract, } from './types.js';
|
|
6
6
|
export { dropdownRoot, dropdownTrigger, dropdownContent, dropdownItem };
|
|
7
|
-
export { default as shadcnDropdownRoot } from './root.proto';
|
|
8
|
-
export { default as shadcnDropdownTrigger } from './trigger.proto';
|
|
9
|
-
export { default as shadcnDropdownContent } from './content.proto';
|
|
10
|
-
export { default as shadcnDropdownItem } from './item.proto';
|
|
7
|
+
export { default as shadcnDropdownRoot } from './root.proto.js';
|
|
8
|
+
export { default as shadcnDropdownTrigger } from './trigger.proto.js';
|
|
9
|
+
export { default as shadcnDropdownContent } from './content.proto.js';
|
|
10
|
+
export { default as shadcnDropdownItem } from './item.proto.js';
|
package/dist/dropdown/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import dropdownContent from './content.proto';
|
|
2
|
-
import dropdownItem from './item.proto';
|
|
3
|
-
import dropdownRoot from './root.proto';
|
|
4
|
-
import dropdownTrigger from './trigger.proto';
|
|
1
|
+
import dropdownContent from './content.proto.js';
|
|
2
|
+
import dropdownItem from './item.proto.js';
|
|
3
|
+
import dropdownRoot from './root.proto.js';
|
|
4
|
+
import dropdownTrigger from './trigger.proto.js';
|
|
5
5
|
export { dropdownRoot, dropdownTrigger, dropdownContent, dropdownItem };
|
|
6
|
-
export { default as shadcnDropdownRoot } from './root.proto';
|
|
7
|
-
export { default as shadcnDropdownTrigger } from './trigger.proto';
|
|
8
|
-
export { default as shadcnDropdownContent } from './content.proto';
|
|
9
|
-
export { default as shadcnDropdownItem } from './item.proto';
|
|
6
|
+
export { default as shadcnDropdownRoot } from './root.proto.js';
|
|
7
|
+
export { default as shadcnDropdownTrigger } from './trigger.proto.js';
|
|
8
|
+
export { default as shadcnDropdownContent } from './content.proto.js';
|
|
9
|
+
export { default as shadcnDropdownItem } from './item.proto.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ShadcnDropdownItemProps } from './types';
|
|
2
|
-
declare const dropdownItem: import("@proto.ui/core").Prototype<ShadcnDropdownItemProps, import("@proto.ui/prototypes-base
|
|
1
|
+
import type { ShadcnDropdownItemProps } from './types.js';
|
|
2
|
+
declare const dropdownItem: import("@proto.ui/core").Prototype<ShadcnDropdownItemProps, import("@proto.ui/prototypes-base").DropdownItemExposes>;
|
|
3
3
|
/** P-SHADCN-DROPDOWN-MENU-ITEM-DIRECT-ENTRY; parity is bounded by P-SHADCN-DROPDOWN-MENU-ITEM-COMPATIBILITY-SUBSET. */
|
|
4
4
|
export default dropdownItem;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const dropdownRoot: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base
|
|
1
|
+
declare const dropdownRoot: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base").DropdownRootProps, import("@proto.ui/prototypes-base").DropdownRootExposes>;
|
|
2
2
|
/** P-SHADCN-DROPDOWN-MENU-DIRECT-ENTRY; parity is bounded by P-SHADCN-DROPDOWN-MENU-COMPATIBILITY-SUBSET. */
|
|
3
3
|
export default dropdownRoot;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ShadcnDropdownTriggerProps } from './types';
|
|
2
|
-
declare const dropdownTrigger: import("@proto.ui/core").Prototype<ShadcnDropdownTriggerProps, import("@proto.ui/prototypes-base
|
|
1
|
+
import type { ShadcnDropdownTriggerProps } from './types.js';
|
|
2
|
+
declare const dropdownTrigger: import("@proto.ui/core").Prototype<ShadcnDropdownTriggerProps, import("@proto.ui/prototypes-base").DropdownTriggerExposes>;
|
|
3
3
|
/** P-SHADCN-DROPDOWN-MENU-TRIGGER-DIRECT-ENTRY; parity is bounded by P-SHADCN-DROPDOWN-MENU-TRIGGER-COMPATIBILITY-SUBSET. */
|
|
4
4
|
export default dropdownTrigger;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const hoverCardContent: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base
|
|
1
|
+
declare const hoverCardContent: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base").HoverCardContentProps, import("@proto.ui/prototypes-base").HoverCardContentExposes>;
|
|
2
2
|
/** P-SHADCN-HOVER-CARD-CONTENT-DIRECT-ENTRY; parity is bounded by P-SHADCN-HOVER-CARD-CONTENT-COMPATIBILITY-SUBSET. */
|
|
3
3
|
export default hoverCardContent;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import hoverCardContent from './content.proto';
|
|
2
|
-
import hoverCardRoot from './root.proto';
|
|
3
|
-
import hoverCardTrigger from './trigger.proto';
|
|
4
|
-
export type { ShadcnHoverCardRootProps, ShadcnHoverCardRootExposes, ShadcnHoverCardRootAsHookContract, ShadcnHoverCardTriggerProps, ShadcnHoverCardTriggerExposes, ShadcnHoverCardTriggerAsHookContract, ShadcnHoverCardContentProps, ShadcnHoverCardContentExposes, ShadcnHoverCardContentAsHookContract, } from './types';
|
|
1
|
+
import hoverCardContent from './content.proto.js';
|
|
2
|
+
import hoverCardRoot from './root.proto.js';
|
|
3
|
+
import hoverCardTrigger from './trigger.proto.js';
|
|
4
|
+
export type { ShadcnHoverCardRootProps, ShadcnHoverCardRootExposes, ShadcnHoverCardRootAsHookContract, ShadcnHoverCardTriggerProps, ShadcnHoverCardTriggerExposes, ShadcnHoverCardTriggerAsHookContract, ShadcnHoverCardContentProps, ShadcnHoverCardContentExposes, ShadcnHoverCardContentAsHookContract, } from './types.js';
|
|
5
5
|
export { hoverCardRoot, hoverCardTrigger, hoverCardContent };
|
|
6
|
-
export { default as shadcnHoverCardRoot } from './root.proto';
|
|
7
|
-
export { default as shadcnHoverCardTrigger } from './trigger.proto';
|
|
8
|
-
export { default as shadcnHoverCardContent } from './content.proto';
|
|
6
|
+
export { default as shadcnHoverCardRoot } from './root.proto.js';
|
|
7
|
+
export { default as shadcnHoverCardTrigger } from './trigger.proto.js';
|
|
8
|
+
export { default as shadcnHoverCardContent } from './content.proto.js';
|
package/dist/hover-card/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import hoverCardContent from './content.proto';
|
|
2
|
-
import hoverCardRoot from './root.proto';
|
|
3
|
-
import hoverCardTrigger from './trigger.proto';
|
|
1
|
+
import hoverCardContent from './content.proto.js';
|
|
2
|
+
import hoverCardRoot from './root.proto.js';
|
|
3
|
+
import hoverCardTrigger from './trigger.proto.js';
|
|
4
4
|
export { hoverCardRoot, hoverCardTrigger, hoverCardContent };
|
|
5
|
-
export { default as shadcnHoverCardRoot } from './root.proto';
|
|
6
|
-
export { default as shadcnHoverCardTrigger } from './trigger.proto';
|
|
7
|
-
export { default as shadcnHoverCardContent } from './content.proto';
|
|
5
|
+
export { default as shadcnHoverCardRoot } from './root.proto.js';
|
|
6
|
+
export { default as shadcnHoverCardTrigger } from './trigger.proto.js';
|
|
7
|
+
export { default as shadcnHoverCardContent } from './content.proto.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const hoverCardRoot: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base
|
|
1
|
+
declare const hoverCardRoot: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base").HoverCardRootProps, import("@proto.ui/prototypes-base").HoverCardRootExposes>;
|
|
2
2
|
/** P-SHADCN-HOVER-CARD-DIRECT-ENTRY; parity is bounded by P-SHADCN-HOVER-CARD-COMPATIBILITY-SUBSET. */
|
|
3
3
|
export default hoverCardRoot;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const hoverCardTrigger: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base
|
|
1
|
+
declare const hoverCardTrigger: import("@proto.ui/core").Prototype<import("@proto.ui/prototypes-base").HoverCardTriggerProps, import("@proto.ui/prototypes-base").HoverCardTriggerExposes>;
|
|
2
2
|
/** P-SHADCN-HOVER-CARD-TRIGGER-DIRECT-ENTRY; parity is bounded by P-SHADCN-HOVER-CARD-TRIGGER-COMPATIBILITY-SUBSET. */
|
|
3
3
|
export default hoverCardTrigger;
|