@stachelock/ui 0.8.3 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,128 @@
1
- import { _ as f } from "../ProfileHeaderAvatar.vue_vue_type_script_setup_true_lang-CKCoHD1o.js";
1
+ import { defineComponent as B, ref as m, computed as r, onMounted as I, onBeforeUnmount as S, createElementBlock as o, openBlock as a, createElementVNode as n, createVNode as U, createCommentVNode as u, normalizeStyle as h, normalizeClass as p, renderSlot as f, createBlock as _, toDisplayString as c, Transition as $, withCtx as j } from "vue";
2
+ import P from "../components/CloudinaryImage.js";
3
+ import { _ as M } from "../_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const R = { class: "sl-relative sl-flex sl-items-center sl-gap-3" }, T = ["aria-expanded"], V = {
5
+ key: 1,
6
+ class: "sl-w-full sl-h-full sl-inline-flex sl-items-center sl-justify-center sl-bg-stachelock-200 dark:sl-bg-stachelock-700"
7
+ }, A = { class: "sl-p-4 sl-border-b sl-border-gray-200 dark:sl-border-slate-700" }, H = { class: "sl-text-sm sl-font-medium sl-text-gray-900 dark:sl-text-white" }, O = { class: "sl-text-xs sl-text-gray-500 dark:sl-text-slate-400" }, D = {
8
+ key: 0,
9
+ class: "sl-py-1"
10
+ }, K = /* @__PURE__ */ B({
11
+ __name: "ProfileHeaderAvatar",
12
+ props: {
13
+ userName: {},
14
+ userEmail: { default: "" },
15
+ imagePublicId: {},
16
+ imageUrl: {},
17
+ showLogout: { type: Boolean, default: !0 },
18
+ logoutLabel: { default: "Log Out" },
19
+ size: { default: 40 },
20
+ ringColor: { default: "#717ecd" },
21
+ ringColorClass: {},
22
+ menuTop: { default: "3rem" },
23
+ menuRight: { default: "0" }
24
+ },
25
+ emits: ["logout", "menu-toggle"],
26
+ setup(s, { expose: y, emit: k }) {
27
+ const e = s, d = k, t = m(!1), b = m(null), x = m(null), w = r(() => !!e.imagePublicId || !!e.imageUrl), C = r(() => e.userName ? e.userName.split(" ").map((l) => l[0]).join("").toUpperCase().slice(0, 2) : "U"), z = r(() => ({
28
+ width: `${e.size}px`,
29
+ height: `${e.size}px`,
30
+ "--avatar-ring-color": e.ringColor
31
+ })), E = r(() => e.size < 32 ? "sl-text-xs" : e.size < 48 ? "sl-text-sm" : "sl-text-base"), L = r(() => ({
32
+ top: e.menuTop,
33
+ right: e.menuRight
34
+ })), g = () => {
35
+ t.value = !t.value, d("menu-toggle", t.value);
36
+ }, i = () => {
37
+ t.value && (t.value = !1, d("menu-toggle", !1));
38
+ }, N = () => {
39
+ i(), d("logout");
40
+ }, v = (l) => {
41
+ l.key === "Escape" && i();
42
+ };
43
+ return I(() => {
44
+ document.addEventListener("keydown", v);
45
+ }), S(() => {
46
+ document.removeEventListener("keydown", v);
47
+ }), y({
48
+ toggleMenu: g,
49
+ closeMenu: i,
50
+ isMenuOpen: t
51
+ }), (l, q) => (a(), o("div", R, [
52
+ n("button", {
53
+ ref_key: "avatarButton",
54
+ ref: b,
55
+ type: "button",
56
+ onClick: g,
57
+ class: p(["profile-avatar-button sl-relative sl-inline-flex sl-items-center sl-justify-center sl-rounded-full sl-overflow-hidden sl-transition-all sl-flex-shrink-0 focus:sl-outline-none", { "is-active": t.value }]),
58
+ style: h(z.value),
59
+ "aria-expanded": t.value,
60
+ "aria-haspopup": "true"
61
+ }, [
62
+ f(l.$slots, "avatar", {}, () => [
63
+ w.value ? (a(), _(P, {
64
+ key: 0,
65
+ src: s.imageUrl,
66
+ "public-id": s.imagePublicId,
67
+ alt: s.userName,
68
+ width: s.size,
69
+ height: s.size,
70
+ "custom-classes": { image: { "sl-w-full sl-h-full sl-object-cover sl-object-center": !0 } },
71
+ skeleton: "user"
72
+ }, null, 8, ["src", "public-id", "alt", "width", "height"])) : (a(), o("div", V, [
73
+ n("span", {
74
+ class: p(["sl-font-semibold sl-text-stachelock-700 dark:sl-text-stachelock-200", E.value])
75
+ }, c(C.value), 3)
76
+ ]))
77
+ ], !0)
78
+ ], 14, T),
79
+ U($, {
80
+ "enter-active-class": "sl-transition sl-ease-out sl-duration-100",
81
+ "enter-from-class": "sl-transform sl-opacity-0 sl-scale-95",
82
+ "enter-to-class": "sl-transform sl-opacity-100 sl-scale-100",
83
+ "leave-active-class": "sl-transition sl-ease-in sl-duration-75",
84
+ "leave-from-class": "sl-transform sl-opacity-100 sl-scale-100",
85
+ "leave-to-class": "sl-transform sl-opacity-0 sl-scale-95"
86
+ }, {
87
+ default: j(() => [
88
+ t.value ? (a(), o("div", {
89
+ key: 0,
90
+ ref_key: "menuRef",
91
+ ref: x,
92
+ class: "sl-absolute sl-bg-white dark:sl-bg-slate-800 sl-rounded-lg sl-shadow-lg sl-border sl-border-gray-200 dark:sl-border-slate-700 sl-z-50 sl-min-w-max sl-overflow-hidden",
93
+ style: h(L.value),
94
+ role: "menu",
95
+ "aria-orientation": "vertical"
96
+ }, [
97
+ n("div", A, [
98
+ f(l.$slots, "menu-header", {}, () => [
99
+ n("p", H, c(s.userName), 1),
100
+ n("p", O, c(s.userEmail), 1)
101
+ ], !0)
102
+ ]),
103
+ l.$slots["menu-items"] ? (a(), o("div", D, [
104
+ f(l.$slots, "menu-items", {}, void 0, !0)
105
+ ])) : u("", !0),
106
+ s.showLogout ? (a(), o("button", {
107
+ key: 1,
108
+ type: "button",
109
+ onClick: N,
110
+ class: "sl-w-full sl-text-left sl-px-4 sl-py-2 sl-text-sm sl-text-red-600 dark:sl-text-red-400 hover:sl-bg-red-50 dark:hover:sl-bg-red-900/20 sl-transition-colors",
111
+ role: "menuitem"
112
+ }, c(s.logoutLabel), 1)) : u("", !0)
113
+ ], 4)) : u("", !0)
114
+ ]),
115
+ _: 3
116
+ }),
117
+ t.value ? (a(), o("div", {
118
+ key: 0,
119
+ class: "sl-fixed sl-inset-0 sl-z-40",
120
+ onClick: i,
121
+ "aria-hidden": "true"
122
+ })) : u("", !0)
123
+ ]));
124
+ }
125
+ }), Q = /* @__PURE__ */ M(K, [["__scopeId", "data-v-52da8fd4"]]);
2
126
  export {
3
- f as default
127
+ Q as default
4
128
  };
@@ -0,0 +1,3 @@
1
+ export * from '../src/components/modals/UiSlideOver'
2
+ import StachelockUI from '../src/components/modals/UiSlideOver'
3
+ export default StachelockUI
@@ -0,0 +1,4 @@
1
+ import { _ as f } from "../UiSlideOver.vue_vue_type_script_setup_true_lang-CjSduy9N.js";
2
+ export {
3
+ f as default
4
+ };
@@ -75,10 +75,10 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
75
75
  }>, {
76
76
  disabled: boolean;
77
77
  height: "sm" | "md" | "lg" | "auto";
78
- ringClasses: string;
79
78
  enableMultiple: boolean;
80
79
  acceptedFormats: AcceptedFileType[];
81
80
  maximumFileSize: number;
81
+ ringClasses: string;
82
82
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
83
83
  default?(_: {}): any;
84
84
  }>;
@@ -0,0 +1,54 @@
1
+ interface Props {
2
+ /** Page title displayed in the card */
3
+ title?: string;
4
+ /** Subtitle/description */
5
+ subtitle?: string;
6
+ /** Whether to show the logo slot */
7
+ showLogo?: boolean;
8
+ /** Max width of the card */
9
+ maxWidth?: 'sm' | 'md' | 'lg' | 'xl';
10
+ /** Whether to show the progress slot */
11
+ showProgress?: boolean;
12
+ }
13
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
14
+ showLogo: boolean;
15
+ maxWidth: string;
16
+ showProgress: boolean;
17
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
18
+ showLogo: boolean;
19
+ maxWidth: string;
20
+ showProgress: boolean;
21
+ }>>> & Readonly<{}>, {
22
+ maxWidth: "sm" | "md" | "lg" | "xl";
23
+ showLogo: boolean;
24
+ showProgress: boolean;
25
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
26
+ logo?(_: {}): any;
27
+ header?(_: {}): any;
28
+ progress?(_: {}): any;
29
+ default?(_: {}): any;
30
+ footer?(_: {}): any;
31
+ }>;
32
+ export default _default;
33
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
34
+ type __VLS_TypePropsToRuntimeProps<T> = {
35
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
36
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
37
+ } : {
38
+ type: import('vue').PropType<T[K]>;
39
+ required: true;
40
+ };
41
+ };
42
+ type __VLS_WithDefaults<P, D> = {
43
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
44
+ default: D[K];
45
+ }> : P[K];
46
+ };
47
+ type __VLS_Prettify<T> = {
48
+ [K in keyof T]: T[K];
49
+ } & {};
50
+ type __VLS_WithTemplateSlots<T, S> = T & {
51
+ new (): {
52
+ $slots: S;
53
+ };
54
+ };
@@ -0,0 +1,100 @@
1
+ import { StepsItemType } from '../../types/layouts';
2
+
3
+ interface Props {
4
+ /** Flow title */
5
+ title?: string;
6
+ /** Flow description */
7
+ subtitle?: string;
8
+ /** Step definitions for built-in stepper */
9
+ steps?: StepsItemType[];
10
+ /** Currently active step */
11
+ currentStep?: StepsItemType;
12
+ /** Show stepper navigation */
13
+ showStepper?: boolean;
14
+ /** Enable next button */
15
+ canGoNext?: boolean;
16
+ /** Enable previous button */
17
+ canGoPrevious?: boolean;
18
+ /** Hide back button on first step */
19
+ isFirstStep?: boolean;
20
+ /** Show "Complete" instead of "Next" */
21
+ isLastStep?: boolean;
22
+ /** Next button label */
23
+ nextLabel?: string;
24
+ /** Previous button label */
25
+ previousLabel?: string;
26
+ /** Final step button label */
27
+ completeLabel?: string;
28
+ /** Show loading state on next button */
29
+ isLoading?: boolean;
30
+ /** Progress percentage (0-100) */
31
+ progress?: number;
32
+ }
33
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
34
+ showStepper: boolean;
35
+ canGoNext: boolean;
36
+ canGoPrevious: boolean;
37
+ isFirstStep: boolean;
38
+ isLastStep: boolean;
39
+ nextLabel: string;
40
+ previousLabel: string;
41
+ completeLabel: string;
42
+ isLoading: boolean;
43
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
44
+ next: () => void;
45
+ previous: () => void;
46
+ "step-change": (step: StepsItemType) => void;
47
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
48
+ showStepper: boolean;
49
+ canGoNext: boolean;
50
+ canGoPrevious: boolean;
51
+ isFirstStep: boolean;
52
+ isLastStep: boolean;
53
+ nextLabel: string;
54
+ previousLabel: string;
55
+ completeLabel: string;
56
+ isLoading: boolean;
57
+ }>>> & Readonly<{
58
+ onNext?: (() => any) | undefined;
59
+ onPrevious?: (() => any) | undefined;
60
+ "onStep-change"?: ((step: StepsItemType) => any) | undefined;
61
+ }>, {
62
+ isLoading: boolean;
63
+ showStepper: boolean;
64
+ canGoNext: boolean;
65
+ canGoPrevious: boolean;
66
+ isFirstStep: boolean;
67
+ isLastStep: boolean;
68
+ nextLabel: string;
69
+ previousLabel: string;
70
+ completeLabel: string;
71
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
72
+ logo?(_: {}): any;
73
+ stepper?(_: {}): any;
74
+ default?(_: {}): any;
75
+ actions?(_: {}): any;
76
+ footer?(_: {}): any;
77
+ }>;
78
+ export default _default;
79
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
80
+ type __VLS_TypePropsToRuntimeProps<T> = {
81
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
82
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
83
+ } : {
84
+ type: import('vue').PropType<T[K]>;
85
+ required: true;
86
+ };
87
+ };
88
+ type __VLS_WithDefaults<P, D> = {
89
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
90
+ default: D[K];
91
+ }> : P[K];
92
+ };
93
+ type __VLS_Prettify<T> = {
94
+ [K in keyof T]: T[K];
95
+ } & {};
96
+ type __VLS_WithTemplateSlots<T, S> = T & {
97
+ new (): {
98
+ $slots: S;
99
+ };
100
+ };
@@ -13,7 +13,13 @@ interface Props {
13
13
  logoutLabel?: string;
14
14
  /** Avatar size in pixels */
15
15
  size?: number;
16
- /** Custom ring color class for hover/active state */
16
+ /**
17
+ * Ring color for hover/active state.
18
+ * Can be a hex color (#3e4b9a), RGB (62 75 154), or CSS variable (var(--my-color))
19
+ * @default Uses stachelock-400 brand color
20
+ */
21
+ ringColor?: string;
22
+ /** @deprecated Use ringColor instead. Kept for backwards compatibility. */
17
23
  ringColorClass?: string;
18
24
  /** Menu position from top */
19
25
  menuTop?: string;
@@ -25,7 +31,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
25
31
  showLogout: boolean;
26
32
  logoutLabel: string;
27
33
  size: number;
28
- ringColorClass: string;
34
+ ringColor: string;
29
35
  menuTop: string;
30
36
  menuRight: string;
31
37
  }>>, {
@@ -40,7 +46,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
40
46
  showLogout: boolean;
41
47
  logoutLabel: string;
42
48
  size: number;
43
- ringColorClass: string;
49
+ ringColor: string;
44
50
  menuTop: string;
45
51
  menuRight: string;
46
52
  }>>> & Readonly<{
@@ -51,7 +57,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
51
57
  userEmail: string;
52
58
  showLogout: boolean;
53
59
  logoutLabel: string;
54
- ringColorClass: string;
60
+ ringColor: string;
55
61
  menuTop: string;
56
62
  menuRight: string;
57
63
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
@@ -1,3 +1,4 @@
1
+ export { default as AuthFlowLayout } from './AuthFlowLayout';
1
2
  export { default as CardLayout } from './CardLayout';
2
3
  export { default as DashboardLayout } from './DashboardLayout';
3
4
  export { default as DefaultLayout } from './DefaultLayout';
@@ -7,6 +8,7 @@ export { default as NavigationGroup } from './NavigationGroup';
7
8
  export { default as NavigationItem } from './NavigationItem';
8
9
  export { default as NestedNavigationItem } from './NestedNavigationItem';
9
10
  export { default as NestedSidebar } from './NestedSidebar';
11
+ export { default as OnboardingLayout } from './OnboardingLayout';
10
12
  export { default as ProfileHeaderAvatar } from './ProfileHeaderAvatar';
11
13
  export { default as ProjectInfoHeader } from './ProjectInfoHeader';
12
14
  export { default as ProjectLogo } from './ProjectLogo';
@@ -1,4 +1,4 @@
1
1
  export { default as AlertModal } from './AlertModal';
2
2
  export { default as BaseModal } from './BaseModal';
3
3
  export { default as ImageCropperModal } from './ImageCropperModal';
4
- export { default as IdeOver } from './UiSlideOver';
4
+ export { default as UiSlideOver } from './UiSlideOver';