@phila/phila-ui-core 2.4.0 → 3.0.0-beta.3

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 CHANGED
@@ -148,6 +148,111 @@ Essential spacing scale: `2`, `4`, `6` (0.5rem, 1rem, 1.5rem)
148
148
 
149
149
  - **Sizes**: base, md
150
150
 
151
+ ### Core Components
152
+
153
+ #### FocusTrap
154
+
155
+ A component that traps focus within its children, ensuring accessibility for modals and dropdowns. It handles keyboard navigation. Optionally, allows escaping to fire custom events when focus leaves.
156
+
157
+ ##### Basic Usage
158
+
159
+ ```html
160
+ <script lang="ts" setup>
161
+ import { FocusTrap } from "@phila/phila-ui-core";
162
+ </script>
163
+ <template>
164
+ <FocusTrap>
165
+ <div>
166
+ <p>This content is focus-trapped. Press Tab to navigate within this area.</p>
167
+ <button>Button 1</button>
168
+ <button>Button 2</button>
169
+ </div>
170
+ </FocusTrap>
171
+ </template>
172
+ ```
173
+
174
+ - When the `FocusTrap` component is mounted, it automatically focuses the first focusable element within its children. If no focusable elements are found, it focuses itself.
175
+ - The component listens for `keydown` events to manage focus. Pressing the Tab key will cycle through the focusable elements within the trap. If the user tries to tab out of the trap, it will loop back to the beginning or end of the focusable elements, depending on the direction of the tabbing.
176
+ - `Shift + Tab` will move focus backward, while `Tab` alone will move focus forward.
177
+ - `PageUp` moves focus to the first focusable element, and `PageDown` moves focus to the last focusable element.
178
+
179
+ | Prop | Type | Description |
180
+ | --------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
181
+ | `initialFocusElement` | `string` | An ID of the element to focus initially when the trap is activated. If the element is not focusable (like a div, heading, span, etc.), the element will be given a temporary `tabindex` of 0 to make initially focusable. |
182
+ | `arrowNavigation` | `boolean` | If true, the component will also listen for ArrowUp and ArrowDown keys to navigate through focusable elements. |
183
+ | `allowEscape` | `boolean` | If true, tabbing outside of the focus trap and focusing on an external element will be allowed. An `escape` event will be emitted that can be listened to by the parent component. Useful for closing navbar menus when using keyboard navigation. |
184
+ | `as` | `string` | The HTML element to render as the wrapper for the focus trap. Defaults to `span`. |
185
+
186
+ ### Composables
187
+
188
+ #### useVisibility
189
+
190
+ A composable for managing visibility state of components, such as dropdowns and modals. It provides methods to toggle visibility and handles hover interactions.
191
+
192
+ ##### Basic Usage
193
+
194
+ ```html
195
+ <script lang="ts" setup>
196
+ // Manage visibility state of a single element
197
+ import { useVisibility } from "@phila/phila-ui-core";
198
+ const { isVisible, toggleProps } = useVisibility({
199
+ id: "my-component",
200
+ group: "my-group", //optional, defaults to "global"
201
+ outsideClickHide: true, //optional, defaults to false.
202
+ });
203
+ </script>
204
+ <template>
205
+ <button v-bind="toggleProps">Toggle Visibility</button>
206
+ <div v-if="isVisible">This content is visible when the button is toggled.</div>
207
+ </template>
208
+ ```
209
+
210
+ - Including an Id prop when calling useVisibility will initilize the visibility state using that ID.
211
+ - Whenever useVisibility is called with the same ID/group, any settings that are defined will be applied to its visibility state.
212
+ - Toggle props includes the required `data-toggle` attribute with the appropriate ID (`visbility-${id}`) and an optional click handler, though you can import `setVisiblity` from the composable and create your own.
213
+
214
+ ```html
215
+ // Accessing visility state across components
216
+ <script lang="ts" setup>
217
+ import { useVisibility } from "@phila/phila-ui-core";
218
+ const { isVisible, setVisibility } = useVisibility({
219
+ group: "my-group",
220
+ });
221
+ const visible = computed(() => isVisible("my-component"));
222
+ const toggleVisibilityExternally = () => {
223
+ setVisibility(!visible.value, "my-component");
224
+ };
225
+ </script>
226
+ <template>
227
+ <button @click="toggleVisibilityExternally">{{ visible ? "Close" : "Open" }} Component</button>
228
+ </template>
229
+ ```
230
+
231
+ ##### useVisibility options
232
+
233
+ | Option | Type | Default | Description |
234
+ | ------------------ | ------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
235
+ | `id` | string | `undefined` | Unique identifier for the visibility state of a component. |
236
+ | `group` | string | `global` | Grouping mechanism for visibility states. Components with the same group will share visibility state. |
237
+ | `blurHide` | boolean | `false` | If true, visbility will be set to false when the component (including focusable children) and its toggle loses focus. |
238
+ | `showSingle` | boolean | `false` | If true, only one component in the same group can be visible at a time. When a component's visibility is set to true, all other components in the same group will have their visibility set to false. |
239
+ | `mouseOverToggle` | boolean | `false` | If true, the exported onMouseEnter and onMouseLeave event handlers will set visibility to true and false, respectively. These event handlers can be applied to a wrapper element to listen for `@onmouseenter` or `@onmouseleave` events. |
240
+ | `outsideClickHide` | boolean | `false` | If true, clicking outside of the component will set its visibility to false. |
241
+ | `escapeKeyHide` | boolean | `false` | If true, pressing the Escape key will set visibility to false. |
242
+ | `visibleOnMount` | boolean | `false` | If true, the component will be visible when it mounts. |
243
+
244
+ ##### useVisiblity methods
245
+
246
+ | Method | Type | Description |
247
+ | ----------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
248
+ | `isVisible` | `(id?: string) => boolean` | A function that takes an optional ID and returns the visibility state (boolean) of the component. If an ID is provided, it returns the visibility state of the component with that ID. If no ID is provided, it returns the visibility state of the component that called the `useVisibility` hook. If no ID was provided when useVisiblity was called, and no ID is provided to isVisiblle, the default ID and group will be used: id: `default-item`, group: `global`. |
249
+ | `setVisibility` | `(visible: boolean, id?: string) => void` | A function that takes a boolean value and an optional ID to set the initial visibility state and sets up click and mouse event listeners for that component. If an ID is provided, it sets the visibility state of the component with that ID. If no ID is provided, it sets the visibility state of the component that called the `useVisibility` hook. If no ID was provided when useVisiblity was called, and no ID is provided to setVisiblity, the default ID and group will be used: id: `default-item`, group: `global`. |
250
+ | `create` | `(id: string) => void` | A function that takes an ID and initializes a new visibility state for the component with that ID. This is called automatically when ID is provided to useVisibility. |
251
+ | `setState` | `(id: string, visible: boolean) => void` | A function that takes an ID and a visible value to manually set the visibility state for a component. `showSingle` rules are preserved, but no event handlers are added/removed. |
252
+ | `onMouseEnter` | `() => void` | An event handler that sets visibility to true when the mouse enters the component. This is only added if the `mouseOverToggle` option is set to true. |
253
+ | `onMouseLeave` | `() => void` | An event handler that sets visibility to false when the mouse leaves the component. This is only added if the `mouseOverToggle` option is set to true. |
254
+ | `visibilityState` | `VisibilityState` | An object that contains the visibility state for all components, organized by group and ID. This is useful for debugging or advanced use cases where you need to access the visibility state of multiple components. |
255
+
151
256
  ## TypeScript Support
152
257
 
153
258
  The package includes TypeScript definitions for all utilities and design tokens.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { ButtonHTMLAttributes } from 'vue';
2
1
  import { ComponentOptionsMixin } from 'vue';
3
2
  import { ComponentProvideOptions } from 'vue';
4
3
  import { ComputedRef } from 'vue';
@@ -57,6 +56,12 @@ iconSize: ComponentSize;
57
56
 
58
57
  declare const __VLS_component_4: DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, PublicProps>;
59
58
 
59
+ declare const __VLS_component_5: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_5<FocusTrapProps>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
60
+ escape: () => void;
61
+ }, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps_5<FocusTrapProps>>> & Readonly<{
62
+ onEscape?: (() => any) | undefined;
63
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
64
+
60
65
  declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
61
66
 
62
67
  declare type __VLS_NonUndefinedable_2<T> = T extends undefined ? never : T;
@@ -65,6 +70,8 @@ declare type __VLS_NonUndefinedable_3<T> = T extends undefined ? never : T;
65
70
 
66
71
  declare type __VLS_NonUndefinedable_4<T> = T extends undefined ? never : T;
67
72
 
73
+ declare type __VLS_NonUndefinedable_5<T> = T extends undefined ? never : T;
74
+
68
75
  declare type __VLS_Prettify<T> = {
69
76
  [K in keyof T]: T[K];
70
77
  } & {};
@@ -94,6 +101,10 @@ declare function __VLS_template_4(): {
94
101
  default?(_: {}): any;
95
102
  };
96
103
 
104
+ declare function __VLS_template_5(): {
105
+ default?(_: {}): any;
106
+ };
107
+
97
108
  declare type __VLS_TypePropsToRuntimeProps<T> = {
98
109
  [K in keyof T]-?: {} extends Pick<T, K> ? {
99
110
  type: PropType<__VLS_NonUndefinedable<T[K]>>;
@@ -130,6 +141,15 @@ declare type __VLS_TypePropsToRuntimeProps_4<T> = {
130
141
  };
131
142
  };
132
143
 
144
+ declare type __VLS_TypePropsToRuntimeProps_5<T> = {
145
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
146
+ type: PropType<__VLS_NonUndefinedable_5<T[K]>>;
147
+ } : {
148
+ type: PropType<T[K]>;
149
+ required: true;
150
+ };
151
+ };
152
+
133
153
  declare type __VLS_WithDefaults<P, D> = {
134
154
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
135
155
  default: D[K];
@@ -160,6 +180,12 @@ declare type __VLS_WithTemplateSlots_4<T, S> = T & {
160
180
  };
161
181
  };
162
182
 
183
+ declare type __VLS_WithTemplateSlots_5<T, S> = T & {
184
+ new (): {
185
+ $slots: S;
186
+ };
187
+ };
188
+
163
189
  /** Accessible icon with required label for screen readers */
164
190
  declare type AccessibleIconProps = {
165
191
  /** Icon is not decorative */
@@ -213,14 +239,6 @@ export declare interface BaseProps {
213
239
  */
214
240
  export declare function cn(...inputs: (string | undefined | null | false)[]): string;
215
241
 
216
- export declare interface CollapseItems {
217
- [id: string]: boolean;
218
- }
219
-
220
- export declare interface CollapseState {
221
- [group: string]: CollapseItems;
222
- }
223
-
224
242
  export declare type ComponentSize = "extra-large" | "large" | "medium" | "small" | "extra-small" | "xxsmall";
225
243
 
226
244
  export declare function debounce<T extends (...args: unknown[]) => void>(callback: T, wait: number): (...args: Parameters<T>) => void;
@@ -235,6 +253,19 @@ declare type DecorativeIconProps = {
235
253
 
236
254
  export declare const ErrorList: DefineComponent<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ValidationProps>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ValidationProps>>> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
237
255
 
256
+ export declare const FocusTrap: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, ReturnType<typeof __VLS_template_5>>;
257
+
258
+ export declare interface FocusTrapEmits {
259
+ (e: "escape"): void;
260
+ }
261
+
262
+ export declare interface FocusTrapProps {
263
+ initialFocusElement?: string;
264
+ arrowNavigation?: boolean;
265
+ allowEscape?: boolean;
266
+ as?: string;
267
+ }
268
+
238
269
  export declare function generateRandomId(prefix?: string): string;
239
270
 
240
271
  export declare interface HtmlLinkProps extends BaseLinkBaseProps {
@@ -298,74 +329,75 @@ export declare interface RouterLinkProps extends BaseLinkBaseProps {
298
329
  rel?: never;
299
330
  }
300
331
 
301
- export declare function useCollapse(props?: UseCollapseProps): {
302
- state: Ref<CollapseState, CollapseState>;
303
- timeout: Ref<NodeJS.Timeout | undefined, NodeJS.Timeout | undefined>;
304
- toggle: (id: string) => void;
305
- toggleSingle: (id: string) => void;
306
- setCollapsed: (id: string, value: boolean) => void;
307
- setSingleCollapsed: (id: string, value: boolean) => void;
308
- isCollapsed: (id: string) => boolean;
309
- reset: () => void;
310
- onMouseEnter: () => void;
311
- onMouseLeave: () => void;
312
- focusChange: (e: FocusEvent) => void;
313
- onClickToggle: (event?: Event) => void;
314
- onClickOpen: (event?: Event) => void;
332
+ export declare function useInput(): {
333
+ inputValue: Ref<string, string>;
334
+ setInputValue: (value: string) => void;
335
+ };
336
+
337
+ export declare function useRouter(): {
338
+ router: unknown;
339
+ hasRouter: ComputedRef<boolean>;
340
+ };
341
+
342
+ export declare function useValidation(props?: ValidationProps_2, emit?: ReturnType<typeof defineEmits_2>): {
343
+ init: () => void;
344
+ validation: () => void;
345
+ isValid: ComputedRef<boolean>;
346
+ errors: ComputedRef<string[]>;
315
347
  };
316
348
 
317
- export declare interface UseCollapseProps {
349
+ export declare function useVisibility(props: UseVisibilityProps): {
350
+ visibilityState: VisibilityState;
351
+ create: (id: string) => void;
352
+ setState: (id: string, visible: boolean) => void;
353
+ isVisible: (id?: string) => boolean;
354
+ onMouseEnter: (id?: string) => void;
355
+ onMouseLeave: (id?: string) => void;
356
+ setVisibility: (visible?: boolean, id?: string) => void;
357
+ toggleProps: ComputedRef< {
358
+ "data-toggle"?: undefined;
359
+ onclick?: undefined;
360
+ } | {
361
+ "data-toggle": string;
362
+ onclick: () => void;
363
+ }>;
364
+ };
365
+
366
+ export declare interface UseVisibilityProps {
318
367
  /**
319
368
  * Unique identifier for the panel
320
369
  */
321
- id: string;
370
+ id?: string;
322
371
  /**
323
- * Group identifier to group multiple panels together
372
+ * Group identifier to group multiple elements together
324
373
  */
325
374
  group?: string;
326
375
  /**
327
- * Close panel when focus is lost on toggle and panel
376
+ * Hide element when focus is lost on toggle and itself
328
377
  */
329
- blurClose?: boolean;
378
+ blurHide?: boolean;
330
379
  /**
331
- * Close all others in group when opened
380
+ * Hide all others in group when opened
332
381
  */
333
- openSingle?: boolean;
382
+ showSingle?: boolean;
334
383
  /**
335
- * Toggle panel open/close on mouse over
384
+ * Toggle visibility on mouse over
336
385
  */
337
386
  mouseOverToggle?: boolean;
338
387
  /**
339
- * Close panel when clicking outside of it and the toggle
388
+ * Hide element when clicking outside of it and the toggle
340
389
  */
341
- outsideClickClose?: boolean;
390
+ outsideClickHide?: boolean;
342
391
  /**
343
- * Close panel when escape key is pressed
392
+ * Hide element when escape key is pressed
344
393
  */
345
- escapeKeyClose?: boolean;
394
+ escapeKeyHide?: boolean;
346
395
  /**
347
- * Additional attributes to bind to the toggle button
396
+ * sets the item (id) as visibile when the modal is mounted
348
397
  */
349
- toggleAttrs?: Partial<ButtonHTMLAttributes>;
398
+ visibleOnMount?: boolean;
350
399
  }
351
400
 
352
- export declare function useInput(): {
353
- inputValue: Ref<string, string>;
354
- setInputValue: (value: string) => void;
355
- };
356
-
357
- export declare function useRouter(): {
358
- router: unknown;
359
- hasRouter: ComputedRef<boolean>;
360
- };
361
-
362
- export declare function useValidation(props?: ValidationProps_2, emit?: ReturnType<typeof defineEmits_2>): {
363
- init: () => void;
364
- validation: () => void;
365
- isValid: ComputedRef<boolean>;
366
- errors: ComputedRef<string[]>;
367
- };
368
-
369
401
  export declare interface ValidationProps {
370
402
  errors?: string[];
371
403
  validateOnBlur?: boolean;
@@ -386,4 +418,16 @@ declare interface ValidationProps_2 {
386
418
  required?: boolean;
387
419
  }
388
420
 
421
+ export declare type VisibilityItem = UseVisibilityProps & {
422
+ visible: boolean;
423
+ };
424
+
425
+ export declare interface VisibilityItems {
426
+ [id: string]: VisibilityItem;
427
+ }
428
+
429
+ export declare interface VisibilityState {
430
+ [group: string]: VisibilityItems;
431
+ }
432
+
389
433
  export { }
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),F=require("@fortawesome/vue-fontawesome");function x(...n){return n.filter(Boolean).join(" ")}function W(n,t){let o;return(...l)=>{o!==void 0&&clearTimeout(o),o=setTimeout(()=>{n(...l)},t)}}function H(n="phila-ui-"){const t=new Uint8Array(16);crypto.getRandomValues(t);const o=Array.from(t,l=>l.toString(36)).join("").substring(0,12);return`${n}-${o}`}const S=e.ref("");function E(){return{inputValue:S,setInputValue:t=>{S.value=t}}}const s=e.reactive({validateOnBlur:!1,validateOnInput:!1,validateOnChange:!1,validateOnMount:!1,required:!1,isValid:!0,errors:[]}),{inputValue:q}=E();function w(n,t){return{init:()=>{n&&(s.validateOnBlur=n.validateOnBlur??!1,s.validateOnInput=n.validateOnInput??!1,s.validateOnChange=n.validateOnChange??!1,s.validateOnMount=n.validateOnMount??!1,s.validate=n.validate,s.required=n.required??!1,s.errors=n.errors||[])},validation:()=>{const a=Object.assign([],n?.errors||[]);if(s.required&&!q.value&&(s.isValid=!1,a.push("This field is required")),s.validate){const i=s.validate(q.value);typeof i=="string"?(s.isValid=!1,a.push(i)):Array.isArray(i)?(s.isValid=!1,a.push(...i)):s.isValid=!0}s.errors=a,a.length>0?(s.isValid=!1,t?.("error",a)):s.isValid=!0},isValid:e.computed(()=>s.isValid),errors:e.computed(()=>s.errors)}}const U={key:0,class:"input-errors"},K=e.defineComponent({__name:"ErrorList",props:{errors:{},validateOnBlur:{type:Boolean},validateOnInput:{type:Boolean},validateOnChange:{type:Boolean},validateOnMount:{type:Boolean},validate:{type:Function},required:{type:Boolean}},setup(n){const{errors:t,isValid:o}=w(),l=n,a=e.computed(()=>Object.assign([],t.value,l.errors||[]));return(i,m)=>!e.unref(o)&&a.value?.length?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(c,d)=>(e.openBlock(),e.createElementBlock("li",{key:d},e.toDisplayString(c),1))),128))])])):e.createCommentVNode("",!0)}}),_=(n,t)=>{const o=n.__vccOpts||n;for(const[l,a]of t)o[l]=a;return o},z=_(K,[["__scopeId","data-v-caba8dd2"]]),G=["for"],J={key:0,class:"required"},Q=e.defineComponent({__name:"InputLabel",props:{id:{},required:{type:Boolean}},setup(n){return(t,o)=>(e.openBlock(),e.createElementBlock("label",{class:"input-label",for:n.id},[e.renderSlot(t.$slots,"default",{},void 0,!0),n.required?(e.openBlock(),e.createElementBlock("span",J,"*")):e.createCommentVNode("",!0)],8,G))}}),M=_(Q,[["__scopeId","data-v-00c91174"]]),X=e.defineComponent({inheritAttrs:!1,__name:"InputWrap",props:{id:{},name:{},placeholder:{},label:{},icon:{},required:{type:Boolean},errors:{},validateOnBlur:{type:Boolean},validateOnInput:{type:Boolean},validateOnChange:{type:Boolean},validateOnMount:{type:Boolean},validate:{type:Function},className:{}},emits:["update:modelValue","input","change","focus","blur","keydown","keyup","keypress","error"],setup(n,{emit:t}){const{setInputValue:o}=E(),l=e.ref(""),a=n,i=t,{init:m,isValid:c,validation:d}=w({validateOnMount:a.validateOnMount??!0,validateOnInput:a.validateOnInput??!0,validateOnBlur:a.validateOnBlur??!0,validateOnChange:a.validateOnChange??!0,required:a.required??!1,errors:a.errors||[],validate:a.validate},i),p=e.computed(()=>({invalid:!c.value})),C=B=>(l.value=B.target.value,i("update:modelValue",l.value),i("input",l.value),o(l.value),a.validateOnInput&&d(),l.value),b=()=>{a.validateOnBlur&&d(),i("blur")},O=()=>{i("focus")};return e.onBeforeMount(()=>{m()}),e.onMounted(()=>{a.validateOnMount&&d()}),(B,T)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input-wrap",{hasError:!e.unref(c)}])},[a.label?(e.openBlock(),e.createBlock(M,{key:0,id:a.id,required:a.required},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.label),1)]),_:1},8,["id","required"])):e.createCommentVNode("",!0),e.renderSlot(B.$slots,"default",e.normalizeProps(e.guardReactiveProps({inputValue:l.value,onBlur:b,onFocus:O,onInput:C,isValid:e.unref(c),inputClasses:p.value})),void 0,!0),e.createVNode(z)],2))}}),Y=_(X,[["__scopeId","data-v-751bf20e"]]),Z=["innerHTML"],ee=["src","alt"],te=e.defineComponent({__name:"Icon",props:{className:{},iconDefinition:{},iconClass:{},src:{},svgRaw:{},variant:{default:"default"},size:{default:"small"},inline:{type:Boolean},shadow:{type:Boolean},decorative:{type:Boolean},ariaLabel:{default:void 0}},setup(n){const t=n,o=e.computed(()=>x("phila-icon",t.size&&`phila-icon--${t.size}`,t.inline&&"phila-icon--inline",t.variant&&t.variant!=="default"&&`phila-icon--${t.variant}`,t.shadow&&"phila-icon--shadow",t.className)),l=e.computed(()=>t.decorative?{"aria-hidden":!0}:{"aria-label":t.ariaLabel,role:"img"});return(a,i)=>(e.openBlock(),e.createElementBlock("span",e.mergeProps({class:o.value},l.value),[t.iconDefinition?(e.openBlock(),e.createBlock(e.unref(F.FontAwesomeIcon),{key:0,icon:t.iconDefinition},null,8,["icon"])):t.iconClass?(e.openBlock(),e.createElementBlock("i",{key:1,class:e.normalizeClass(`fa fa-${t.iconClass}`)},null,2)):t.svgRaw?(e.openBlock(),e.createElementBlock("span",{key:2,class:"phila-icon__svg",innerHTML:t.svgRaw},null,8,Z)):t.src?(e.openBlock(),e.createElementBlock("img",{key:3,src:t.src,alt:t.decorative?"":t.ariaLabel||"Icon"},null,8,ee)):e.createCommentVNode("",!0)],16))}}),V=_(te,[["__scopeId","data-v-1fe4be50"]]),ne={key:1},ae=e.defineComponent({__name:"ActionContent",props:{iconRight:{type:Boolean,default:!1},iconOnly:{type:Boolean,default:!1},inline:{type:Boolean},text:{default:void 0},size:{default:void 0},shadow:{type:Boolean},iconSize:{default:void 0},iconDefinition:{},iconClass:{},src:{},svgRaw:{},variant:{}},setup(n){const t=n,o=e.computed(()=>t.iconDefinition||t.iconClass||t.src||t.svgRaw),l=i=>{if(i.iconOnly)switch(i.size){case"small":return"extra-small";case"extra-small":return"xxsmall";default:return i.size||"medium"}else switch(i.size){case"small":case"extra-small":return"xxsmall";default:return"extra-small"}},a=e.computed(()=>({iconDefinition:t.iconDefinition,iconClass:t.iconClass,src:t.src,svgRaw:t.svgRaw,size:t.iconSize??l(t),decorative:!0,class:"icon",inline:t.inline??!t.iconOnly,shadow:t.shadow}));return(i,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o.value&&!t.iconRight?(e.openBlock(),e.createBlock(V,e.normalizeProps(e.mergeProps({key:0},a.value)),null,16)):e.createCommentVNode("",!0),t.iconOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ne,[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])])),o.value&&t.iconRight?(e.openBlock(),e.createBlock(V,e.normalizeProps(e.mergeProps({key:2},a.value)),null,16)):e.createCommentVNode("",!0)],64))}}),L=n=>"to"in n&&n.to!==void 0;function N(){const n=e.inject("router",null),t=e.computed(()=>n!==null);return{router:n,hasRouter:t}}const oe=e.defineComponent({__name:"BaseLink",props:{to:{},href:{},target:{},rel:{},disabled:{type:Boolean},ariaLabel:{},className:{}},setup(n){const t=n,{hasRouter:o}=N(),l=e.computed(()=>L(t)&&o.value?e.resolveComponent("RouterLink"):"a"),a=e.computed(()=>L(t)?{to:t.disabled?void 0:t.to,...t.disabled&&{"aria-disabled":"true"},...t.ariaLabel&&{"aria-label":t.ariaLabel}}:{href:t.disabled?void 0:t.href,...t.target&&{target:t.target},...t.rel&&{rel:t.rel},...t.disabled&&{"aria-disabled":"true"},...t.ariaLabel&&{"aria-label":t.ariaLabel}});return(i,m)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({class:n.className},a.value),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["class"]))}}),v=e.ref({}),f=e.ref(),h=400,I=e.ref(null);function le(n){const t=n?.group??"global",o=(r,u)=>{v.value[t][r]=u},l=(r,u)=>{v.value[t]={[r]:u}},a=r=>v.value[t]?.[r]??!1,i=r=>{o(r,!a(r))},m=r=>{l(r,!a(r))},c=()=>{v.value[t]={}},d=r=>{r.key==="Escape"&&(o(n.id,!1),g())},p=r=>{if(!n)return;const u=r.target,[y]=Object.keys(v.value[t]).filter(j=>v.value[t][j]===!0),k=document.getElementById(y),D=document.querySelector(`[aria-controls="${y}"]`),P=u.getAttribute("aria-controls")===y||D?.contains(r.target);k&&!k.contains(u)&&!P&&(o(n.id,!1),g())},C=()=>{n&&(f.value=setTimeout(()=>{o(n.id,!1),g()},h))},b=()=>{n&&n.mouseOverToggle===!0&&(I.value=n.id,f.value=setTimeout(()=>{$()},h))},O=()=>{n&&n.mouseOverToggle===!0&&(I.value=null,clearTimeout(f.value),f.value=setTimeout(()=>{I.value!==n.id&&(o(n.id,!1),g())},h))},B=r=>{if(!n)return;const{relatedTarget:u}=r;if(!u||u.getAttribute("aria-controls")===n.id)return;const k=document.getElementById(n.id);k&&k.contains(u)||(clearTimeout(f.value),f.value=setTimeout(()=>{n.openSingle?l(n.id,!1):o(n.id,!1),g()},h))},T=()=>{n&&(n.outsideClickClose&&(document.addEventListener("click",p),document.addEventListener("touchend",p)),n.escapeKeyClose&&document.addEventListener("keydown",d))},g=()=>{document.removeEventListener("click",p),document.removeEventListener("touchend",p),document.removeEventListener("keydown",d),document.removeEventListener("scroll",C)},R=r=>{n&&(r?.preventDefault(),clearTimeout(f.value),T())},A=r=>{n&&(R(r),n.openSingle?m(n.id):i(n.id))},$=r=>{n&&(R(r),n.openSingle?l(n.id,!0):o(n.id,!0))};return e.onBeforeMount(()=>{v.value[t]||c()}),e.onUnmounted(()=>{g()}),{state:v,timeout:f,toggle:i,toggleSingle:m,setCollapsed:o,setSingleCollapsed:l,isCollapsed:a,reset:c,onMouseEnter:b,onMouseLeave:O,focusChange:B,onClickToggle:A,onClickOpen:$}}exports.ActionContent=ae;exports.BaseLink=oe;exports.ErrorList=z;exports.Icon=V;exports.InputLabel=M;exports.InputWrap=Y;exports.cn=x;exports.debounce=W;exports.generateRandomId=H;exports.isRouterLink=L;exports.useCollapse=le;exports.useInput=E;exports.useRouter=N;exports.useValidation=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),N=require("@fortawesome/vue-fontawesome");function S(...n){return n.filter(Boolean).join(" ")}function z(n,t){let i;return(...r)=>{i!==void 0&&clearTimeout(i),i=setTimeout(()=>{n(...r)},t)}}function P(n="phila-ui-"){const t=new Uint8Array(16);crypto.getRandomValues(t);const i=Array.from(t,r=>r.toString(36)).join("").substring(0,12);return`${n}-${i}`}const L=e.ref("");function I(){return{inputValue:L,setInputValue:t=>{L.value=t}}}const d=e.reactive({validateOnBlur:!1,validateOnInput:!1,validateOnChange:!1,validateOnMount:!1,required:!1,isValid:!0,errors:[]}),{inputValue:x}=I();function w(n,t){return{init:()=>{n&&(d.validateOnBlur=n.validateOnBlur??!1,d.validateOnInput=n.validateOnInput??!1,d.validateOnChange=n.validateOnChange??!1,d.validateOnMount=n.validateOnMount??!1,d.validate=n.validate,d.required=n.required??!1,d.errors=n.errors||[])},validation:()=>{const o=Object.assign([],n?.errors||[]);if(d.required&&!x.value&&(d.isValid=!1,o.push("This field is required")),d.validate){const s=d.validate(x.value);typeof s=="string"?(d.isValid=!1,o.push(s)):Array.isArray(s)?(d.isValid=!1,o.push(...s)):d.isValid=!0}d.errors=o,o.length>0?(d.isValid=!1,t?.("error",o)):d.isValid=!0},isValid:e.computed(()=>d.isValid),errors:e.computed(()=>d.errors)}}const F={key:0,class:"input-errors"},H=e.defineComponent({__name:"ErrorList",props:{errors:{},validateOnBlur:{type:Boolean},validateOnInput:{type:Boolean},validateOnChange:{type:Boolean},validateOnMount:{type:Boolean},validate:{type:Function},required:{type:Boolean}},setup(n){const{errors:t,isValid:i}=w(),r=n,o=e.computed(()=>Object.assign([],t.value,r.errors||[]));return(s,y)=>!e.unref(i)&&o.value?.length?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(p,m)=>(e.openBlock(),e.createElementBlock("li",{key:m},e.toDisplayString(p),1))),128))])])):e.createCommentVNode("",!0)}}),_=(n,t)=>{const i=n.__vccOpts||n;for(const[r,o]of t)i[r]=o;return i},$=_(H,[["__scopeId","data-v-caba8dd2"]]),j=["for"],K={key:0,class:"required"},U=e.defineComponent({__name:"InputLabel",props:{id:{},required:{type:Boolean}},setup(n){return(t,i)=>(e.openBlock(),e.createElementBlock("label",{class:"input-label",for:n.id},[e.renderSlot(t.$slots,"default",{},void 0,!0),n.required?(e.openBlock(),e.createElementBlock("span",K,"*")):e.createCommentVNode("",!0)],8,j))}}),q=_(U,[["__scopeId","data-v-00c91174"]]),W=e.defineComponent({inheritAttrs:!1,__name:"InputWrap",props:{id:{},name:{},placeholder:{},label:{},icon:{},required:{type:Boolean},errors:{},validateOnBlur:{type:Boolean},validateOnInput:{type:Boolean},validateOnChange:{type:Boolean},validateOnMount:{type:Boolean},validate:{type:Function},className:{}},emits:["update:modelValue","input","change","focus","blur","keydown","keyup","keypress","error"],setup(n,{emit:t}){const{setInputValue:i}=I(),r=e.ref(""),o=n,s=t,{init:y,isValid:p,validation:m}=w({validateOnMount:o.validateOnMount??!0,validateOnInput:o.validateOnInput??!0,validateOnBlur:o.validateOnBlur??!0,validateOnChange:o.validateOnChange??!0,required:o.required??!1,errors:o.errors||[],validate:o.validate},s),l=e.computed(()=>({invalid:!p.value})),c=k=>(r.value=k.target.value,s("update:modelValue",r.value),s("input",r.value),i(r.value),o.validateOnInput&&m(),r.value),v=()=>{o.validateOnBlur&&m(),s("blur")},g=()=>{s("focus")};return e.onBeforeMount(()=>{y()}),e.onMounted(()=>{o.validateOnMount&&m()}),(k,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input-wrap",{hasError:!e.unref(p)}])},[o.label?(e.openBlock(),e.createBlock(q,{key:0,id:o.id,required:o.required},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:1},8,["id","required"])):e.createCommentVNode("",!0),e.renderSlot(k.$slots,"default",e.normalizeProps(e.guardReactiveProps({inputValue:r.value,onBlur:v,onFocus:g,onInput:c,isValid:e.unref(p),inputClasses:l.value})),void 0,!0),e.createVNode($)],2))}}),G=_(W,[["__scopeId","data-v-751bf20e"]]),J=["innerHTML"],Q=["src","alt"],X=e.defineComponent({__name:"Icon",props:{className:{},iconDefinition:{},iconClass:{},src:{},svgRaw:{},variant:{default:"default"},size:{default:"small"},inline:{type:Boolean},shadow:{type:Boolean},decorative:{type:Boolean},ariaLabel:{default:void 0}},setup(n){const t=n,i=e.computed(()=>S("phila-icon",t.size&&`phila-icon--${t.size}`,t.inline&&"phila-icon--inline",t.variant&&t.variant!=="default"&&`phila-icon--${t.variant}`,t.shadow&&"phila-icon--shadow",t.className)),r=e.computed(()=>t.decorative?{"aria-hidden":!0}:{"aria-label":t.ariaLabel,role:"img"});return(o,s)=>(e.openBlock(),e.createElementBlock("span",e.mergeProps({class:i.value},r.value),[t.iconDefinition?(e.openBlock(),e.createBlock(e.unref(N.FontAwesomeIcon),{key:0,icon:t.iconDefinition},null,8,["icon"])):t.iconClass?(e.openBlock(),e.createElementBlock("i",{key:1,class:e.normalizeClass(`fa fa-${t.iconClass}`)},null,2)):t.svgRaw?(e.openBlock(),e.createElementBlock("span",{key:2,class:"phila-icon__svg",innerHTML:t.svgRaw},null,8,J)):t.src?(e.openBlock(),e.createElementBlock("img",{key:3,src:t.src,alt:t.decorative?"":t.ariaLabel||"Icon"},null,8,Q)):e.createCommentVNode("",!0)],16))}}),O=_(X,[["__scopeId","data-v-1fe4be50"]]),Y={key:1},Z=e.defineComponent({__name:"ActionContent",props:{iconRight:{type:Boolean,default:!1},iconOnly:{type:Boolean,default:!1},inline:{type:Boolean},text:{default:void 0},size:{default:void 0},shadow:{type:Boolean},iconSize:{default:void 0},iconDefinition:{},iconClass:{},src:{},svgRaw:{},variant:{}},setup(n){const t=n,i=e.computed(()=>t.iconDefinition||t.iconClass||t.src||t.svgRaw),r=s=>{if(s.iconOnly)switch(s.size){case"small":return"extra-small";case"extra-small":return"xxsmall";default:return s.size||"medium"}else switch(s.size){case"small":case"extra-small":return"xxsmall";default:return"extra-small"}},o=e.computed(()=>({iconDefinition:t.iconDefinition,iconClass:t.iconClass,src:t.src,svgRaw:t.svgRaw,size:t.iconSize??r(t),decorative:!0,class:"icon",inline:t.inline??!t.iconOnly,shadow:t.shadow}));return(s,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[i.value&&!t.iconRight?(e.openBlock(),e.createBlock(O,e.normalizeProps(e.mergeProps({key:0},o.value)),null,16)):e.createCommentVNode("",!0),t.iconOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Y,[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])])),i.value&&t.iconRight?(e.openBlock(),e.createBlock(O,e.normalizeProps(e.mergeProps({key:2},o.value)),null,16)):e.createCommentVNode("",!0)],64))}}),C=n=>"to"in n&&n.to!==void 0;function D(){const n=e.inject("router",null),t=e.computed(()=>n!==null);return{router:n,hasRouter:t}}const ee=e.defineComponent({__name:"BaseLink",props:{to:{},href:{},target:{},rel:{},disabled:{type:Boolean},ariaLabel:{},className:{}},setup(n){const t=n,{hasRouter:i}=D(),r=e.computed(()=>C(t)&&i.value?e.resolveComponent("RouterLink"):"a"),o=e.computed(()=>C(t)?{to:t.disabled?void 0:t.to,...t.disabled&&{"aria-disabled":"true"},...t.ariaLabel&&{"aria-label":t.ariaLabel}}:{href:t.disabled?void 0:t.href,...t.target&&{target:t.target},...t.rel&&{rel:t.rel},...t.disabled&&{"aria-disabled":"true"},...t.ariaLabel&&{"aria-label":t.ariaLabel}});return(s,y)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),e.mergeProps({class:n.className},o.value),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16,["class"]))}}),te='a,area,button,iframe,input,object,textarea,select,details,[tabindex]:not([tabindex="-1"])',ne=e.defineComponent({__name:"FocusTrap",props:{initialFocusElement:{},arrowNavigation:{type:Boolean},allowEscape:{type:Boolean},as:{}},emits:["escape"],setup(n,{emit:t}){const i=e.useTemplateRef("focusTrap"),r=e.ref([]),o=n,s=t,y=e.useAttrs(),p=l=>{const c=r.value;if(c.length===0)return;const v=c[0],g=c[c.length-1];if(l.key==="Tab"&&(l.shiftKey?document.activeElement===v&&(o.allowEscape?s("escape"):(l.preventDefault(),g.focus())):document.activeElement===g&&(o.allowEscape?s("escape"):(l.preventDefault(),v.focus()))),l.key==="PageUp"&&(l.preventDefault(),v.focus()),l.key==="PageDown"&&(l.preventDefault(),g.focus()),o.arrowNavigation){const k=c.indexOf(document.activeElement);if(l.key==="ArrowDown"||l.key==="ArrowRight"){l.preventDefault();const a=(k+1)%c.length;c[a].focus()}if(l.key==="ArrowUp"||l.key==="ArrowLeft"){l.preventDefault();const a=(k-1+c.length)%c.length;c[a].focus()}}},m=l=>{l.target.removeAttribute("tabindex")};return e.onMounted(()=>{const l=i.value?.querySelectorAll(te);if(l){l.forEach(v=>{v.addEventListener("keydown",p)}),r.value=Array.from(l);let c=r.value[0];if(o.initialFocusElement){const v=i.value?.querySelector(`${o.initialFocusElement}`);v&&(v.tabIndex===-1&&(v.tabIndex=0,v.addEventListener("blur",m,{once:!0})),c=v)}else c||(c=i.value,c.tabIndex=0,c.addEventListener("blur",m,{once:!0}));c.focus()}}),e.onBeforeUnmount(()=>{r.value.forEach(l=>{l.removeEventListener("keydown",p),l.removeEventListener("blur",m)})}),(l,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.as||"span"),e.mergeProps({ref_key:"focusTrap",ref:i},e.unref(y)),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16))}}),u=e.reactive({}),B=e.ref(),T=400,E=e.ref(null),R={id:"default-item",group:"global"};function oe(n){const t=n.group||R.group,i=n.id||R.id,r=(a,f)=>{const b=u[t]?.[a];b&&(b.showSingle?Object.keys(u[t]).forEach(h=>{u[t][h].visible=h===a?f:!1}):u[t][a].visible=f)},o=(a=!0,f)=>{clearTimeout(B.value),r(f??i,a),a&&v(f??i)},s=a=>u[t]?.[a??i]?.visible??!1,y=a=>{u[t]||(u[t]={}),u[t][a]||(u[t][a]={group:t,visible:!1}),n.blurHide!==void 0&&(u[t][a].blurHide=n.blurHide),n.showSingle!==void 0&&(u[t][a].showSingle=n.showSingle),n.mouseOverToggle!==void 0&&(u[t][a].mouseOverToggle=n.mouseOverToggle),n.outsideClickHide!==void 0&&(u[t][a].outsideClickHide=n.outsideClickHide),n.escapeKeyHide!==void 0&&(u[t][a].escapeKeyHide=n.escapeKeyHide)},p=a=>f=>{f.key==="Escape"&&(r(a,!1),g())},m=a=>f=>{if(!u[t])return;const b=f.target,[h]=Object.keys(u[t]).filter(M=>u[t][M].visible===!0),V=document.getElementById(h),A=document.querySelector(`[data-toggle="visibility-${h}"]`)?.contains(f.target);V&&!V.contains(b)&&!A&&(r(a??i,!1),g())},l=a=>{(u[t]?.[a??i]).mouseOverToggle===!0&&(E.value=a??i,B.value=setTimeout(()=>{o(!0,a)},T))},c=a=>{(u[t]?.[a??i]).mouseOverToggle===!0&&(E.value=null,clearTimeout(B.value),B.value=setTimeout(()=>{E.value!==(a??i)&&(r(a??i,!1),g())},T))},v=a=>{const f=u[t]?.[a];f?.outsideClickHide&&(document.addEventListener("click",m(a)),document.addEventListener("touchend",m(a))),f?.escapeKeyHide&&document.addEventListener("keydown",p(a))},g=()=>{u[t]&&Object.keys(u[t]).forEach(a=>{document.removeEventListener("click",m(a)),document.removeEventListener("touchend",m(a)),document.removeEventListener("keydown",p(a))})};e.onBeforeMount(()=>{n.id!==void 0&&(y(n.id),e.nextTick(()=>{n.visibleOnMount&&o(!0)}))}),e.onUnmounted(()=>{g()});const k=e.computed(()=>n.id?{"data-toggle":`visibility-${i}`,onclick:()=>o(!s(i))}:{});return{visibilityState:u,create:y,setState:r,isVisible:s,onMouseEnter:l,onMouseLeave:c,setVisibility:o,toggleProps:k}}exports.ActionContent=Z;exports.BaseLink=ee;exports.ErrorList=$;exports.FocusTrap=ne;exports.Icon=O;exports.InputLabel=q;exports.InputWrap=G;exports.cn=S;exports.debounce=z;exports.generateRandomId=P;exports.isRouterLink=C;exports.useInput=I;exports.useRouter=D;exports.useValidation=w;exports.useVisibility=oe;
package/dist/index.mjs CHANGED
@@ -1,32 +1,32 @@
1
- import { ref as k, reactive as te, computed as c, defineComponent as O, createElementBlock as u, createCommentVNode as y, unref as V, openBlock as s, createElementVNode as ne, Fragment as H, renderList as ae, toDisplayString as z, renderSlot as T, onBeforeMount as U, onMounted as ie, normalizeClass as W, createBlock as C, createVNode as le, withCtx as K, createTextVNode as G, normalizeProps as M, guardReactiveProps as re, mergeProps as w, inject as oe, resolveComponent as se, resolveDynamicComponent as ue, onUnmounted as ce } from "vue";
1
+ import { ref as L, reactive as j, computed as g, defineComponent as k, createElementBlock as p, createCommentVNode as O, unref as B, openBlock as d, createElementVNode as ee, Fragment as P, renderList as te, toDisplayString as A, renderSlot as V, onBeforeMount as K, onMounted as U, normalizeClass as G, createBlock as E, createVNode as ne, withCtx as q, createTextVNode as W, normalizeProps as R, guardReactiveProps as ae, mergeProps as I, inject as ie, resolveComponent as oe, resolveDynamicComponent as J, useTemplateRef as se, useAttrs as re, onBeforeUnmount as le, nextTick as ue, onUnmounted as ce } from "vue";
2
2
  import { FontAwesomeIcon as de } from "@fortawesome/vue-fontawesome";
3
- import './index.css';function ve(...t) {
3
+ import './index.css';function fe(...t) {
4
4
  return t.filter(Boolean).join(" ");
5
5
  }
6
- function we(t, e) {
7
- let a;
8
- return (...i) => {
9
- a !== void 0 && clearTimeout(a), a = setTimeout(() => {
10
- t(...i);
6
+ function Ce(t, e) {
7
+ let i;
8
+ return (...o) => {
9
+ i !== void 0 && clearTimeout(i), i = setTimeout(() => {
10
+ t(...o);
11
11
  }, e);
12
12
  };
13
13
  }
14
14
  function Te(t = "phila-ui-") {
15
15
  const e = new Uint8Array(16);
16
16
  crypto.getRandomValues(e);
17
- const a = Array.from(e, (i) => i.toString(36)).join("").substring(0, 12);
18
- return `${t}-${a}`;
17
+ const i = Array.from(e, (o) => o.toString(36)).join("").substring(0, 12);
18
+ return `${t}-${i}`;
19
19
  }
20
- const N = k("");
21
- function J() {
20
+ const S = L("");
21
+ function Q() {
22
22
  return {
23
- inputValue: N,
23
+ inputValue: S,
24
24
  setInputValue: (e) => {
25
- N.value = e;
25
+ S.value = e;
26
26
  }
27
27
  };
28
28
  }
29
- const o = te({
29
+ const c = j({
30
30
  validateOnBlur: !1,
31
31
  validateOnInput: !1,
32
32
  validateOnChange: !1,
@@ -34,28 +34,28 @@ const o = te({
34
34
  required: !1,
35
35
  isValid: !0,
36
36
  errors: []
37
- }), { inputValue: j } = J();
38
- function Q(t, e) {
37
+ }), { inputValue: M } = Q();
38
+ function X(t, e) {
39
39
  return {
40
40
  init: () => {
41
- t && (o.validateOnBlur = t.validateOnBlur ?? !1, o.validateOnInput = t.validateOnInput ?? !1, o.validateOnChange = t.validateOnChange ?? !1, o.validateOnMount = t.validateOnMount ?? !1, o.validate = t.validate, o.required = t.required ?? !1, o.errors = t.errors || []);
41
+ t && (c.validateOnBlur = t.validateOnBlur ?? !1, c.validateOnInput = t.validateOnInput ?? !1, c.validateOnChange = t.validateOnChange ?? !1, c.validateOnMount = t.validateOnMount ?? !1, c.validate = t.validate, c.required = t.required ?? !1, c.errors = t.errors || []);
42
42
  },
43
43
  validation: () => {
44
44
  const n = Object.assign([], t?.errors || []);
45
- if (o.required && !j.value && (o.isValid = !1, n.push("This field is required")), o.validate) {
46
- const l = o.validate(j.value);
47
- typeof l == "string" ? (o.isValid = !1, n.push(l)) : Array.isArray(l) ? (o.isValid = !1, n.push(...l)) : o.isValid = !0;
45
+ if (c.required && !M.value && (c.isValid = !1, n.push("This field is required")), c.validate) {
46
+ const r = c.validate(M.value);
47
+ typeof r == "string" ? (c.isValid = !1, n.push(r)) : Array.isArray(r) ? (c.isValid = !1, n.push(...r)) : c.isValid = !0;
48
48
  }
49
- o.errors = n, n.length > 0 ? (o.isValid = !1, e?.("error", n)) : o.isValid = !0;
49
+ c.errors = n, n.length > 0 ? (c.isValid = !1, e?.("error", n)) : c.isValid = !0;
50
50
  },
51
- isValid: c(() => o.isValid),
52
- errors: c(() => o.errors)
51
+ isValid: g(() => c.isValid),
52
+ errors: g(() => c.errors)
53
53
  };
54
54
  }
55
- const fe = {
55
+ const ve = {
56
56
  key: 0,
57
57
  class: "input-errors"
58
- }, me = /* @__PURE__ */ O({
58
+ }, me = /* @__PURE__ */ k({
59
59
  __name: "ErrorList",
60
60
  props: {
61
61
  errors: {},
@@ -67,37 +67,37 @@ const fe = {
67
67
  required: { type: Boolean }
68
68
  },
69
69
  setup(t) {
70
- const { errors: e, isValid: a } = Q(), i = t, n = c(() => Object.assign([], e.value, i.errors || []));
71
- return (l, h) => !V(a) && n.value?.length ? (s(), u("div", fe, [
72
- ne("ul", null, [
73
- (s(!0), u(H, null, ae(n.value, (v, f) => (s(), u("li", { key: f }, z(v), 1))), 128))
70
+ const { errors: e, isValid: i } = X(), o = t, n = g(() => Object.assign([], e.value, o.errors || []));
71
+ return (r, b) => !B(i) && n.value?.length ? (d(), p("div", ve, [
72
+ ee("ul", null, [
73
+ (d(!0), p(P, null, te(n.value, (y, m) => (d(), p("li", { key: m }, A(y), 1))), 128))
74
74
  ])
75
- ])) : y("", !0);
75
+ ])) : O("", !0);
76
76
  }
77
- }), $ = (t, e) => {
78
- const a = t.__vccOpts || t;
79
- for (const [i, n] of e)
80
- a[i] = n;
81
- return a;
82
- }, ge = /* @__PURE__ */ $(me, [["__scopeId", "data-v-caba8dd2"]]), he = ["for"], ye = {
77
+ }), T = (t, e) => {
78
+ const i = t.__vccOpts || t;
79
+ for (const [o, n] of e)
80
+ i[o] = n;
81
+ return i;
82
+ }, pe = /* @__PURE__ */ T(me, [["__scopeId", "data-v-caba8dd2"]]), ge = ["for"], ye = {
83
83
  key: 0,
84
84
  class: "required"
85
- }, _e = /* @__PURE__ */ O({
85
+ }, he = /* @__PURE__ */ k({
86
86
  __name: "InputLabel",
87
87
  props: {
88
88
  id: {},
89
89
  required: { type: Boolean }
90
90
  },
91
91
  setup(t) {
92
- return (e, a) => (s(), u("label", {
92
+ return (e, i) => (d(), p("label", {
93
93
  class: "input-label",
94
94
  for: t.id
95
95
  }, [
96
- T(e.$slots, "default", {}, void 0, !0),
97
- t.required ? (s(), u("span", ye, "*")) : y("", !0)
98
- ], 8, he));
96
+ V(e.$slots, "default", {}, void 0, !0),
97
+ t.required ? (d(), p("span", ye, "*")) : O("", !0)
98
+ ], 8, ge));
99
99
  }
100
- }), pe = /* @__PURE__ */ $(_e, [["__scopeId", "data-v-00c91174"]]), Oe = /* @__PURE__ */ O({
100
+ }), be = /* @__PURE__ */ T(he, [["__scopeId", "data-v-00c91174"]]), _e = /* @__PURE__ */ k({
101
101
  inheritAttrs: !1,
102
102
  __name: "InputWrap",
103
103
  props: {
@@ -117,7 +117,7 @@ const fe = {
117
117
  },
118
118
  emits: ["update:modelValue", "input", "change", "focus", "blur", "keydown", "keyup", "keypress", "error"],
119
119
  setup(t, { emit: e }) {
120
- const { setInputValue: a } = J(), i = k(""), n = t, l = e, { init: h, isValid: v, validation: f } = Q(
120
+ const { setInputValue: i } = Q(), o = L(""), n = t, r = e, { init: b, isValid: y, validation: m } = X(
121
121
  {
122
122
  validateOnMount: n.validateOnMount ?? !0,
123
123
  validateOnInput: n.validateOnInput ?? !0,
@@ -127,36 +127,36 @@ const fe = {
127
127
  errors: n.errors || [],
128
128
  validate: n.validate
129
129
  },
130
- l
131
- ), _ = c(() => ({
132
- invalid: !v.value
133
- })), R = (b) => (i.value = b.target.value, l("update:modelValue", i.value), l("input", i.value), a(i.value), n.validateOnInput && f(), i.value), E = () => {
134
- n.validateOnBlur && f(), l("blur");
135
- }, q = () => {
136
- l("focus");
130
+ r
131
+ ), s = g(() => ({
132
+ invalid: !y.value
133
+ })), l = (_) => (o.value = _.target.value, r("update:modelValue", o.value), r("input", o.value), i(o.value), n.validateOnInput && m(), o.value), v = () => {
134
+ n.validateOnBlur && m(), r("blur");
135
+ }, h = () => {
136
+ r("focus");
137
137
  };
138
- return U(() => {
139
- h();
140
- }), ie(() => {
141
- n.validateOnMount && f();
142
- }), (b, S) => (s(), u("div", {
143
- class: W(["input-wrap", { hasError: !V(v) }])
138
+ return K(() => {
139
+ b();
140
+ }), U(() => {
141
+ n.validateOnMount && m();
142
+ }), (_, a) => (d(), p("div", {
143
+ class: G(["input-wrap", { hasError: !B(y) }])
144
144
  }, [
145
- n.label ? (s(), C(pe, {
145
+ n.label ? (d(), E(be, {
146
146
  key: 0,
147
147
  id: n.id,
148
148
  required: n.required
149
149
  }, {
150
- default: K(() => [
151
- G(z(n.label), 1)
150
+ default: q(() => [
151
+ W(A(n.label), 1)
152
152
  ]),
153
153
  _: 1
154
- }, 8, ["id", "required"])) : y("", !0),
155
- T(b.$slots, "default", M(re({ inputValue: i.value, onBlur: E, onFocus: q, onInput: R, isValid: V(v), inputClasses: _.value })), void 0, !0),
156
- le(ge)
154
+ }, 8, ["id", "required"])) : O("", !0),
155
+ V(_.$slots, "default", R(ae({ inputValue: o.value, onBlur: v, onFocus: h, onInput: l, isValid: B(y), inputClasses: s.value })), void 0, !0),
156
+ ne(pe)
157
157
  ], 2));
158
158
  }
159
- }), $e = /* @__PURE__ */ $(Oe, [["__scopeId", "data-v-751bf20e"]]), be = ["innerHTML"], Be = ["src", "alt"], Ce = /* @__PURE__ */ O({
159
+ }), $e = /* @__PURE__ */ T(_e, [["__scopeId", "data-v-751bf20e"]]), Oe = ["innerHTML"], ke = ["src", "alt"], Ee = /* @__PURE__ */ k({
160
160
  __name: "Icon",
161
161
  props: {
162
162
  className: {},
@@ -172,38 +172,38 @@ const fe = {
172
172
  ariaLabel: { default: void 0 }
173
173
  },
174
174
  setup(t) {
175
- const e = t, a = c(() => ve(
175
+ const e = t, i = g(() => fe(
176
176
  "phila-icon",
177
177
  e.size && `phila-icon--${e.size}`,
178
178
  e.inline && "phila-icon--inline",
179
179
  e.variant && e.variant !== "default" && `phila-icon--${e.variant}`,
180
180
  e.shadow && "phila-icon--shadow",
181
181
  e.className
182
- )), i = c(() => e.decorative ? {
182
+ )), o = g(() => e.decorative ? {
183
183
  "aria-hidden": !0
184
184
  } : {
185
185
  "aria-label": e.ariaLabel,
186
186
  role: "img"
187
187
  });
188
- return (n, l) => (s(), u("span", w({ class: a.value }, i.value), [
189
- e.iconDefinition ? (s(), C(V(de), {
188
+ return (n, r) => (d(), p("span", I({ class: i.value }, o.value), [
189
+ e.iconDefinition ? (d(), E(B(de), {
190
190
  key: 0,
191
191
  icon: e.iconDefinition
192
- }, null, 8, ["icon"])) : e.iconClass ? (s(), u("i", {
192
+ }, null, 8, ["icon"])) : e.iconClass ? (d(), p("i", {
193
193
  key: 1,
194
- class: W(`fa fa-${e.iconClass}`)
195
- }, null, 2)) : e.svgRaw ? (s(), u("span", {
194
+ class: G(`fa fa-${e.iconClass}`)
195
+ }, null, 2)) : e.svgRaw ? (d(), p("span", {
196
196
  key: 2,
197
197
  class: "phila-icon__svg",
198
198
  innerHTML: e.svgRaw
199
- }, null, 8, be)) : e.src ? (s(), u("img", {
199
+ }, null, 8, Oe)) : e.src ? (d(), p("img", {
200
200
  key: 3,
201
201
  src: e.src,
202
202
  alt: e.decorative ? "" : e.ariaLabel || "Icon"
203
- }, null, 8, Be)) : y("", !0)
203
+ }, null, 8, ke)) : O("", !0)
204
204
  ], 16));
205
205
  }
206
- }), F = /* @__PURE__ */ $(Ce, [["__scopeId", "data-v-1fe4be50"]]), ke = { key: 1 }, Re = /* @__PURE__ */ O({
206
+ }), z = /* @__PURE__ */ T(Ee, [["__scopeId", "data-v-1fe4be50"]]), we = { key: 1 }, Re = /* @__PURE__ */ k({
207
207
  __name: "ActionContent",
208
208
  props: {
209
209
  iconRight: { type: Boolean, default: !1 },
@@ -220,56 +220,56 @@ const fe = {
220
220
  variant: {}
221
221
  },
222
222
  setup(t) {
223
- const e = t, a = c(() => e.iconDefinition || e.iconClass || e.src || e.svgRaw), i = (l) => {
224
- if (l.iconOnly)
225
- switch (l.size) {
223
+ const e = t, i = g(() => e.iconDefinition || e.iconClass || e.src || e.svgRaw), o = (r) => {
224
+ if (r.iconOnly)
225
+ switch (r.size) {
226
226
  case "small":
227
227
  return "extra-small";
228
228
  case "extra-small":
229
229
  return "xxsmall";
230
230
  default:
231
- return l.size || "medium";
231
+ return r.size || "medium";
232
232
  }
233
233
  else
234
- switch (l.size) {
234
+ switch (r.size) {
235
235
  case "small":
236
236
  case "extra-small":
237
237
  return "xxsmall";
238
238
  default:
239
239
  return "extra-small";
240
240
  }
241
- }, n = c(
241
+ }, n = g(
242
242
  () => ({
243
243
  iconDefinition: e.iconDefinition,
244
244
  iconClass: e.iconClass,
245
245
  src: e.src,
246
246
  svgRaw: e.svgRaw,
247
- size: e.iconSize ?? i(e),
247
+ size: e.iconSize ?? o(e),
248
248
  decorative: !0,
249
249
  class: "icon",
250
250
  inline: e.inline ?? !e.iconOnly,
251
251
  shadow: e.shadow
252
252
  })
253
253
  );
254
- return (l, h) => (s(), u(H, null, [
255
- a.value && !e.iconRight ? (s(), C(F, M(w({ key: 0 }, n.value)), null, 16)) : y("", !0),
256
- e.iconOnly ? y("", !0) : (s(), u("span", ke, [
257
- T(l.$slots, "default", {}, () => [
258
- G(z(e.text), 1)
254
+ return (r, b) => (d(), p(P, null, [
255
+ i.value && !e.iconRight ? (d(), E(z, R(I({ key: 0 }, n.value)), null, 16)) : O("", !0),
256
+ e.iconOnly ? O("", !0) : (d(), p("span", we, [
257
+ V(r.$slots, "default", {}, () => [
258
+ W(A(e.text), 1)
259
259
  ])
260
260
  ])),
261
- a.value && e.iconRight ? (s(), C(F, M(w({ key: 2 }, n.value)), null, 16)) : y("", !0)
261
+ i.value && e.iconRight ? (d(), E(z, R(I({ key: 2 }, n.value)), null, 16)) : O("", !0)
262
262
  ], 64));
263
263
  }
264
- }), P = (t) => "to" in t && t.to !== void 0;
265
- function Ie() {
266
- const t = oe("router", null), e = c(() => t !== null);
264
+ }), H = (t) => "to" in t && t.to !== void 0;
265
+ function Be() {
266
+ const t = ie("router", null), e = g(() => t !== null);
267
267
  return {
268
268
  router: t,
269
269
  hasRouter: e
270
270
  };
271
271
  }
272
- const Ee = /* @__PURE__ */ O({
272
+ const Ae = /* @__PURE__ */ k({
273
273
  __name: "BaseLink",
274
274
  props: {
275
275
  to: {},
@@ -281,7 +281,7 @@ const Ee = /* @__PURE__ */ O({
281
281
  className: {}
282
282
  },
283
283
  setup(t) {
284
- const e = t, { hasRouter: a } = Ie(), i = c(() => P(e) && a.value ? se("RouterLink") : "a"), n = c(() => P(e) ? {
284
+ const e = t, { hasRouter: i } = Be(), o = g(() => H(e) && i.value ? oe("RouterLink") : "a"), n = g(() => H(e) ? {
285
285
  to: e.disabled ? void 0 : e.to,
286
286
  ...e.disabled && { "aria-disabled": "true" },
287
287
  ...e.ariaLabel && { "aria-label": e.ariaLabel }
@@ -292,96 +292,145 @@ const Ee = /* @__PURE__ */ O({
292
292
  ...e.disabled && { "aria-disabled": "true" },
293
293
  ...e.ariaLabel && { "aria-label": e.ariaLabel }
294
294
  });
295
- return (l, h) => (s(), C(ue(i.value), w({ class: t.className }, n.value), {
296
- default: K(() => [
297
- T(l.$slots, "default")
295
+ return (r, b) => (d(), E(J(o.value), I({ class: t.className }, n.value), {
296
+ default: q(() => [
297
+ V(r.$slots, "default")
298
298
  ]),
299
299
  _: 3
300
300
  }, 16, ["class"]));
301
301
  }
302
- }), m = k({}), g = k(), L = 400, x = k(null);
303
- function qe(t) {
304
- const e = t?.group ?? "global", a = (r, d) => {
305
- m.value[e][r] = d;
306
- }, i = (r, d) => {
307
- m.value[e] = { [r]: d };
308
- }, n = (r) => m.value[e]?.[r] ?? !1, l = (r) => {
309
- a(r, !n(r));
310
- }, h = (r) => {
311
- i(r, !n(r));
312
- }, v = () => {
313
- m.value[e] = {};
314
- }, f = (r) => {
315
- r.key === "Escape" && (a(t.id, !1), p());
316
- }, _ = (r) => {
317
- if (!t) return;
318
- const d = r.target, [I] = Object.keys(m.value[e]).filter((ee) => m.value[e][ee] === !0), B = document.getElementById(I), Y = document.querySelector(`[aria-controls="${I}"]`), Z = d.getAttribute("aria-controls") === I || Y?.contains(r.target);
319
- B && !B.contains(d) && !Z && (a(t.id, !1), p());
320
- }, R = () => {
321
- t && (g.value = setTimeout(() => {
322
- a(t.id, !1), p();
323
- }, L));
324
- }, E = () => {
325
- t && t.mouseOverToggle === !0 && (x.value = t.id, g.value = setTimeout(() => {
326
- D();
327
- }, L));
328
- }, q = () => {
329
- t && t.mouseOverToggle === !0 && (x.value = null, clearTimeout(g.value), g.value = setTimeout(() => {
330
- x.value !== t.id && (a(t.id, !1), p());
331
- }, L));
332
- }, b = (r) => {
333
- if (!t) return;
334
- const { relatedTarget: d } = r;
335
- if (!d || d.getAttribute("aria-controls") === t.id)
336
- return;
337
- const B = document.getElementById(t.id);
338
- B && B.contains(d) || (clearTimeout(g.value), g.value = setTimeout(() => {
339
- t.openSingle ? i(t.id, !1) : a(t.id, !1), p();
340
- }, L));
341
- }, S = () => {
342
- t && (t.outsideClickClose && (document.addEventListener("click", _), document.addEventListener("touchend", _)), t.escapeKeyClose && document.addEventListener("keydown", f));
343
- }, p = () => {
344
- document.removeEventListener("click", _), document.removeEventListener("touchend", _), document.removeEventListener("keydown", f), document.removeEventListener("scroll", R);
345
- }, A = (r) => {
346
- t && (r?.preventDefault(), clearTimeout(g.value), S());
347
- }, X = (r) => {
348
- t && (A(r), t.openSingle ? h(t.id) : l(t.id));
349
- }, D = (r) => {
350
- t && (A(r), t.openSingle ? i(t.id, !0) : a(t.id, !0));
302
+ }), Ie = 'a,area,button,iframe,input,object,textarea,select,details,[tabindex]:not([tabindex="-1"])', qe = /* @__PURE__ */ k({
303
+ __name: "FocusTrap",
304
+ props: {
305
+ initialFocusElement: {},
306
+ arrowNavigation: { type: Boolean },
307
+ allowEscape: { type: Boolean },
308
+ as: {}
309
+ },
310
+ emits: ["escape"],
311
+ setup(t, { emit: e }) {
312
+ const i = se("focusTrap"), o = L([]), n = t, r = e, b = re(), y = (s) => {
313
+ const l = o.value;
314
+ if (l.length === 0) return;
315
+ const v = l[0], h = l[l.length - 1];
316
+ if (s.key === "Tab" && (s.shiftKey ? document.activeElement === v && (n.allowEscape ? r("escape") : (s.preventDefault(), h.focus())) : document.activeElement === h && (n.allowEscape ? r("escape") : (s.preventDefault(), v.focus()))), s.key === "PageUp" && (s.preventDefault(), v.focus()), s.key === "PageDown" && (s.preventDefault(), h.focus()), n.arrowNavigation) {
317
+ const _ = l.indexOf(document.activeElement);
318
+ if (s.key === "ArrowDown" || s.key === "ArrowRight") {
319
+ s.preventDefault();
320
+ const a = (_ + 1) % l.length;
321
+ l[a].focus();
322
+ }
323
+ if (s.key === "ArrowUp" || s.key === "ArrowLeft") {
324
+ s.preventDefault();
325
+ const a = (_ - 1 + l.length) % l.length;
326
+ l[a].focus();
327
+ }
328
+ }
329
+ }, m = (s) => {
330
+ s.target.removeAttribute("tabindex");
331
+ };
332
+ return U(() => {
333
+ const s = i.value?.querySelectorAll(Ie);
334
+ if (s) {
335
+ s.forEach((v) => {
336
+ v.addEventListener("keydown", y);
337
+ }), o.value = Array.from(s);
338
+ let l = o.value[0];
339
+ if (n.initialFocusElement) {
340
+ const v = i.value?.querySelector(`${n.initialFocusElement}`);
341
+ v && (v.tabIndex === -1 && (v.tabIndex = 0, v.addEventListener("blur", m, { once: !0 })), l = v);
342
+ } else l || (l = i.value, l.tabIndex = 0, l.addEventListener("blur", m, { once: !0 }));
343
+ l.focus();
344
+ }
345
+ }), le(() => {
346
+ o.value.forEach((s) => {
347
+ s.removeEventListener("keydown", y), s.removeEventListener("blur", m);
348
+ });
349
+ }), (s, l) => (d(), E(J(n.as || "span"), I({
350
+ ref_key: "focusTrap",
351
+ ref: i
352
+ }, B(b)), {
353
+ default: q(() => [
354
+ V(s.$slots, "default")
355
+ ]),
356
+ _: 3
357
+ }, 16));
358
+ }
359
+ }), u = j({}), C = L(), F = 400, $ = L(null), N = {
360
+ id: "default-item",
361
+ group: "global"
362
+ };
363
+ function De(t) {
364
+ const e = t.group || N.group, i = t.id || N.id, o = (a, f) => {
365
+ const x = u[e]?.[a];
366
+ x && (x.showSingle ? Object.keys(u[e]).forEach((w) => {
367
+ u[e][w].visible = w === a ? f : !1;
368
+ }) : u[e][a].visible = f);
369
+ }, n = (a = !0, f) => {
370
+ clearTimeout(C.value), o(f ?? i, a), a && v(f ?? i);
371
+ }, r = (a) => u[e]?.[a ?? i]?.visible ?? !1, b = (a) => {
372
+ u[e] || (u[e] = {}), u[e][a] || (u[e][a] = {
373
+ group: e,
374
+ visible: !1
375
+ }), t.blurHide !== void 0 && (u[e][a].blurHide = t.blurHide), t.showSingle !== void 0 && (u[e][a].showSingle = t.showSingle), t.mouseOverToggle !== void 0 && (u[e][a].mouseOverToggle = t.mouseOverToggle), t.outsideClickHide !== void 0 && (u[e][a].outsideClickHide = t.outsideClickHide), t.escapeKeyHide !== void 0 && (u[e][a].escapeKeyHide = t.escapeKeyHide);
376
+ }, y = (a) => (f) => {
377
+ f.key === "Escape" && (o(a, !1), h());
378
+ }, m = (a) => (f) => {
379
+ if (!u[e]) return;
380
+ const x = f.target, [w] = Object.keys(u[e]).filter((Z) => u[e][Z].visible === !0), D = document.getElementById(w), Y = document.querySelector(`[data-toggle="visibility-${w}"]`)?.contains(f.target);
381
+ D && !D.contains(x) && !Y && (o(a ?? i, !1), h());
382
+ }, s = (a) => {
383
+ (u[e]?.[a ?? i]).mouseOverToggle === !0 && ($.value = a ?? i, C.value = setTimeout(() => {
384
+ n(!0, a);
385
+ }, F));
386
+ }, l = (a) => {
387
+ (u[e]?.[a ?? i]).mouseOverToggle === !0 && ($.value = null, clearTimeout(C.value), C.value = setTimeout(() => {
388
+ $.value !== (a ?? i) && (o(a ?? i, !1), h());
389
+ }, F));
390
+ }, v = (a) => {
391
+ const f = u[e]?.[a];
392
+ f?.outsideClickHide && (document.addEventListener("click", m(a)), document.addEventListener("touchend", m(a))), f?.escapeKeyHide && document.addEventListener("keydown", y(a));
393
+ }, h = () => {
394
+ u[e] && Object.keys(u[e]).forEach((a) => {
395
+ document.removeEventListener("click", m(a)), document.removeEventListener("touchend", m(a)), document.removeEventListener("keydown", y(a));
396
+ });
351
397
  };
352
- return U(() => {
353
- m.value[e] || v();
398
+ K(() => {
399
+ t.id !== void 0 && (b(t.id), ue(() => {
400
+ t.visibleOnMount && n(!0);
401
+ }));
354
402
  }), ce(() => {
355
- p();
356
- }), {
357
- state: m,
358
- timeout: g,
359
- toggle: l,
360
- toggleSingle: h,
361
- setCollapsed: a,
362
- setSingleCollapsed: i,
363
- isCollapsed: n,
364
- reset: v,
365
- onMouseEnter: E,
366
- onMouseLeave: q,
367
- focusChange: b,
368
- onClickToggle: X,
369
- onClickOpen: D
403
+ h();
404
+ });
405
+ const _ = g(() => t.id ? {
406
+ "data-toggle": `visibility-${i}`,
407
+ onclick: () => n(!r(i))
408
+ } : {});
409
+ return {
410
+ visibilityState: u,
411
+ create: b,
412
+ setState: o,
413
+ isVisible: r,
414
+ onMouseEnter: s,
415
+ onMouseLeave: l,
416
+ setVisibility: n,
417
+ toggleProps: _
370
418
  };
371
419
  }
372
420
  export {
373
421
  Re as ActionContent,
374
- Ee as BaseLink,
375
- ge as ErrorList,
376
- F as Icon,
377
- pe as InputLabel,
422
+ Ae as BaseLink,
423
+ pe as ErrorList,
424
+ qe as FocusTrap,
425
+ z as Icon,
426
+ be as InputLabel,
378
427
  $e as InputWrap,
379
- ve as cn,
380
- we as debounce,
428
+ fe as cn,
429
+ Ce as debounce,
381
430
  Te as generateRandomId,
382
- P as isRouterLink,
383
- qe as useCollapse,
384
- J as useInput,
385
- Ie as useRouter,
386
- Q as useValidation
431
+ H as isRouterLink,
432
+ Q as useInput,
433
+ Be as useRouter,
434
+ X as useValidation,
435
+ De as useVisibility
387
436
  };
@@ -43,6 +43,9 @@
43
43
  .is-flex-row {
44
44
  flex-direction: row;
45
45
  }
46
+ .is-overflow-hidden {
47
+ overflow: hidden;
48
+ }
46
49
  .is-12 {
47
50
  flex: 0 0 100%;
48
51
  max-width: 100%;
@@ -25,6 +25,13 @@
25
25
  .has-text-center {
26
26
  text-align: center !important;
27
27
  }
28
+ .has-text-label-3xl {
29
+ font-family: var(--Label-3XL-font-label-3xl-family) !important;
30
+ font-size: var(--Label-3XL-font-label-3xl-size) !important;
31
+ font-style: normal;
32
+ font-weight: 600;
33
+ line-height: var(--Label-3XL-font-label-3xl-lineheight) !important;
34
+ }
28
35
  .has-text-label-small {
29
36
  font-family: var(--Label-ExtraSmall-font-label-xs-family) !important;
30
37
  font-size: var(--Label-ExtraSmall-font-label-xs-size) !important;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phila/phila-ui-core",
3
- "version": "2.4.0",
3
+ "version": "3.0.0-beta.3",
4
4
  "type": "module",
5
5
  "description": "Core utilities and styles for Phila UI library",
6
6
  "main": "./dist/index.js",