@flux-ui/components 3.0.0-next.33 → 3.0.0-next.35

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.
Files changed (44) hide show
  1. package/dist/component/FluxBoxedIcon.vue.d.ts +1 -5
  2. package/dist/component/FluxCommandPalette.vue.d.ts +52 -0
  3. package/dist/component/FluxCommandPaletteGroup.vue.d.ts +8 -0
  4. package/dist/component/FluxCommandPaletteItem.vue.d.ts +18 -0
  5. package/dist/component/FluxFormDateRangeInput.vue.d.ts +1 -5
  6. package/dist/component/FluxTag.vue.d.ts +1 -0
  7. package/dist/component/index.d.ts +4 -1
  8. package/dist/composable/private/useCommandPalette.d.ts +38 -0
  9. package/dist/index.css +320 -0
  10. package/dist/index.js +686 -120
  11. package/dist/index.js.map +1 -1
  12. package/package.json +10 -10
  13. package/src/component/FluxBoxedIcon.vue +0 -4
  14. package/src/component/FluxCalendar.vue +2 -1
  15. package/src/component/FluxChip.vue +1 -1
  16. package/src/component/FluxColorPicker.vue +1 -1
  17. package/src/component/FluxColorSelect.vue +3 -3
  18. package/src/component/FluxCommandPalette.vue +290 -0
  19. package/src/component/FluxCommandPaletteGroup.vue +23 -0
  20. package/src/component/FluxCommandPaletteItem.vue +60 -0
  21. package/src/component/FluxDatePicker.vue +0 -1
  22. package/src/component/FluxFader.vue +2 -2
  23. package/src/component/FluxFocalPointEditor.vue +3 -3
  24. package/src/component/FluxFormDateRangeInput.vue +0 -5
  25. package/src/component/FluxFormDateTimeInput.vue +2 -2
  26. package/src/component/FluxFormSelect.vue +2 -2
  27. package/src/component/FluxFormTextArea.vue +1 -0
  28. package/src/component/FluxQuantitySelector.vue +3 -6
  29. package/src/component/FluxSnackbar.vue +5 -3
  30. package/src/component/FluxTableActions.vue +3 -3
  31. package/src/component/FluxTag.vue +3 -1
  32. package/src/component/index.ts +4 -1
  33. package/src/component/primitive/CoordinatePicker.vue +10 -11
  34. package/src/component/primitive/FilterItem.vue +11 -2
  35. package/src/component/primitive/SelectBase.vue +2 -2
  36. package/src/component/primitive/SliderBase.vue +10 -13
  37. package/src/composable/private/useCommandPalette.ts +405 -0
  38. package/src/composable/private/useFormSelect.ts +2 -2
  39. package/src/css/component/Badge.module.scss +7 -0
  40. package/src/css/component/CommandPalette.module.scss +332 -0
  41. package/src/css/reset.scss +0 -107
  42. package/src/css/variables.scss +0 -26
  43. /package/dist/component/{FluxActions.vue.d.ts → FluxActionStack.vue.d.ts} +0 -0
  44. /package/src/component/{FluxActions.vue → FluxActionStack.vue} +0 -0
@@ -5,9 +5,5 @@ type __VLS_Props = {
5
5
  readonly name: FluxIconName;
6
6
  readonly size?: number;
7
7
  };
8
- declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
9
- click: (args_0: MouseEvent) => any;
10
- }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
11
- onClick?: (args_0: MouseEvent) => any;
12
- }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
8
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
13
9
  export default _default;
@@ -0,0 +1,52 @@
1
+ import { FluxCommandSource, FluxCommandSourceItem, FluxIconName } from '@flux-ui/types';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, GlobalComponents, GlobalDirectives } from 'vue';
3
+ type __VLS_Props = {
4
+ readonly hasKeyboardShortcut?: boolean;
5
+ readonly placeholder?: string;
6
+ readonly sources: FluxCommandSource[];
7
+ };
8
+ declare function open(): void;
9
+ declare function close(): void;
10
+ declare const _default: DefineComponent<__VLS_Props, {
11
+ close: typeof close;
12
+ open: typeof open;
13
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
14
+ select: (item: FluxCommandSourceItem) => any;
15
+ }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ onSelect?: (item: FluxCommandSourceItem) => any;
17
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
18
+ dialogRef: HTMLDivElement;
19
+ inputRef: HTMLInputElement;
20
+ itemRefs: CreateComponentPublicInstanceWithMixins<Readonly<{
21
+ readonly command?: string;
22
+ readonly hasSubActions?: boolean;
23
+ readonly icon?: FluxIconName;
24
+ readonly isHighlighted?: boolean;
25
+ readonly label: string;
26
+ readonly subLabel?: string;
27
+ }> & Readonly<{
28
+ onActivate?: () => any;
29
+ onHighlight?: () => any;
30
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
31
+ activate: () => any;
32
+ highlight: () => any;
33
+ }, PublicProps, {}, false, {}, {}, GlobalComponents, GlobalDirectives, string, {}, HTMLButtonElement, ComponentProvideOptions, {
34
+ P: {};
35
+ B: {};
36
+ D: {};
37
+ C: {};
38
+ M: {};
39
+ Defaults: {};
40
+ }, Readonly<{
41
+ readonly command?: string;
42
+ readonly hasSubActions?: boolean;
43
+ readonly icon?: FluxIconName;
44
+ readonly isHighlighted?: boolean;
45
+ readonly label: string;
46
+ readonly subLabel?: string;
47
+ }> & Readonly<{
48
+ onActivate?: () => any;
49
+ onHighlight?: () => any;
50
+ }>, {}, {}, {}, {}, {}>[];
51
+ }, any>;
52
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { FluxIconName } from '@flux-ui/types';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ type __VLS_Props = {
4
+ readonly icon?: FluxIconName;
5
+ readonly label: string;
6
+ };
7
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
8
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { FluxIconName } from '@flux-ui/types';
2
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
+ type __VLS_Props = {
4
+ readonly command?: string;
5
+ readonly hasSubActions?: boolean;
6
+ readonly icon?: FluxIconName;
7
+ readonly isHighlighted?: boolean;
8
+ readonly label: string;
9
+ readonly subLabel?: string;
10
+ };
11
+ declare const _default: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
12
+ activate: () => any;
13
+ highlight: () => any;
14
+ }, string, PublicProps, Readonly<__VLS_Props> & Readonly<{
15
+ onActivate?: () => any;
16
+ onHighlight?: () => any;
17
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
18
+ export default _default;
@@ -1,15 +1,11 @@
1
- import { FluxAutoCompleteType, FluxDirection } from '@flux-ui/types';
2
1
  import { DateTime } from 'luxon';
3
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, ComponentInternalInstance, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, GlobalComponents, GlobalDirectives, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties } from 'vue';
3
+ import { FluxDirection } from '@flux-ui/types';
4
4
  import { OnCleanup } from '@vue/reactivity';
5
5
  type __VLS_Props = {
6
- readonly autoComplete?: FluxAutoCompleteType;
7
- readonly autoFocus?: boolean;
8
6
  readonly disabled?: boolean;
9
- readonly isReadonly?: boolean;
10
7
  readonly max?: DateTime;
11
8
  readonly min?: DateTime;
12
- readonly placeholder?: string;
13
9
  readonly rangeMode?: 'range' | 'week' | 'month';
14
10
  };
15
11
  type __VLS_PublicProps = {
@@ -6,6 +6,7 @@ type __VLS_Props = {
6
6
  readonly icon?: FluxIconName;
7
7
  readonly isClickable?: boolean;
8
8
  readonly isDeletable?: boolean;
9
+ readonly isKeyboardShortcut?: boolean;
9
10
  readonly isLoading?: boolean;
10
11
  readonly label: string;
11
12
  readonly type?: FluxPressableType;
@@ -1,7 +1,7 @@
1
1
  export { default as FluxAction } from './FluxAction.vue';
2
2
  export { default as FluxActionBar } from './FluxActionBar.vue';
3
3
  export { default as FluxActionPane } from './FluxActionPane.vue';
4
- export { default as FluxActions } from './FluxActions.vue';
4
+ export { default as FluxActionStack } from './FluxActionStack.vue';
5
5
  export { default as FluxAnimatedColors } from './FluxAnimatedColors.vue';
6
6
  export { default as FluxAspectRatio } from './FluxAspectRatio.vue';
7
7
  export { default as FluxAutoGrid } from './FluxAutoGrid.vue';
@@ -18,6 +18,9 @@ export { default as FluxCalendarEvent } from './FluxCalendarEvent.vue';
18
18
  export { default as FluxCheckbox } from './FluxCheckbox.vue';
19
19
  export { default as FluxChip } from './FluxChip.vue';
20
20
  export { default as FluxClickablePane } from './FluxClickablePane.vue';
21
+ export { default as FluxCommandPalette } from './FluxCommandPalette.vue';
22
+ export { default as FluxCommandPaletteGroup } from './FluxCommandPaletteGroup.vue';
23
+ export { default as FluxCommandPaletteItem } from './FluxCommandPaletteItem.vue';
21
24
  export { default as FluxComment } from './FluxComment.vue';
22
25
  export { default as FluxColorPicker } from './FluxColorPicker.vue';
23
26
  export { default as FluxColorSelect } from './FluxColorSelect.vue';
@@ -0,0 +1,38 @@
1
+ import { FluxCommandSource, FluxCommandSourceItem, FluxCommandSubAction } from '@flux-ui/types';
2
+ import { Ref } from 'vue';
3
+ export type CommandPaletteResultItem = {
4
+ readonly globalIndex: number;
5
+ readonly sourceKey: string;
6
+ readonly sourceLabel: string;
7
+ readonly item: FluxCommandSourceItem;
8
+ };
9
+ export type CommandPaletteGroup = {
10
+ readonly sourceKey: string;
11
+ readonly sourceLabel: string;
12
+ readonly startIndex: number;
13
+ readonly items: CommandPaletteResultItem[];
14
+ };
15
+ export declare function useCommandPalette(params: {
16
+ readonly sources: Ref<FluxCommandSource[]>;
17
+ readonly itemRefs: Readonly<Ref<Array<{
18
+ readonly $el: HTMLElement;
19
+ }> | null | undefined>>;
20
+ }): {
21
+ readonly search: Ref<string>;
22
+ readonly activeTab: Ref<string | null>;
23
+ readonly highlightedIndex: Ref<number>;
24
+ readonly isLoading: Ref<boolean>;
25
+ readonly isTransitioningBack: Ref<boolean>;
26
+ readonly subActionTarget: Ref<FluxCommandSourceItem | null>;
27
+ readonly filteredItems: Ref<CommandPaletteResultItem[]>;
28
+ readonly groupedItems: Ref<CommandPaletteGroup[]>;
29
+ readonly subActions: Ref<FluxCommandSubAction[]>;
30
+ readonly activeTabSource: Ref<FluxCommandSource | null>;
31
+ readonly tabs: Ref<FluxCommandSource[]>;
32
+ readonly totalItems: Ref<number>;
33
+ setSearch: (value: string) => void;
34
+ setActiveTab: (key: string | null) => void;
35
+ enterSubActions: (item: FluxCommandSourceItem) => void;
36
+ onKeyNavigate: (evt: KeyboardEvent, onClose: () => void, onActivate: (item: FluxCommandSourceItem) => void) => void;
37
+ reset: () => void;
38
+ };
package/dist/index.css CHANGED
@@ -1903,6 +1903,11 @@
1903
1903
  font-weight: 400;
1904
1904
  }
1905
1905
 
1906
+ .tag-keyboard-shortcut {
1907
+ padding-left: 3px;
1908
+ padding-right: 3px;
1909
+ }
1910
+
1906
1911
  .tag-close {
1907
1912
  border-radius: var(--radius-half);
1908
1913
  }
@@ -3585,6 +3590,321 @@
3585
3590
  font-size: 14px;
3586
3591
  font-weight: 500;
3587
3592
  white-space: nowrap;
3593
+ }.command-palette-backdrop {
3594
+ position: fixed;
3595
+ inset: 0;
3596
+ background: var(--overlay);
3597
+ backdrop-filter: blur(3px) saturate(180%);
3598
+ animation: command-palette-backdrop-in 300ms var(--swift-out) both;
3599
+ z-index: 99000;
3600
+ }
3601
+ .command-palette-backdrop.is-closing {
3602
+ animation: command-palette-backdrop-out 210ms var(--swift-out) both;
3603
+ }
3604
+
3605
+ .command-palette-dialog {
3606
+ position: fixed;
3607
+ inset: 0;
3608
+ display: flex;
3609
+ padding-top: clamp(60px, 15vh, 160px);
3610
+ align-items: flex-start;
3611
+ justify-content: center;
3612
+ animation: command-palette-in 300ms var(--swift-out) both;
3613
+ z-index: 99001;
3614
+ }
3615
+ .command-palette-dialog.is-closing {
3616
+ animation: command-palette-out 210ms var(--swift-out) both;
3617
+ pointer-events: none;
3618
+ }
3619
+
3620
+ .command-palette {
3621
+ display: flex;
3622
+ overflow: hidden;
3623
+ width: min(600px, 100dvw - 48px);
3624
+ max-height: min(480px, 100dvh - 120px - clamp(60px, 15vh, 160px));
3625
+ flex-flow: column nowrap;
3626
+ background: var(--surface);
3627
+ background-clip: padding-box;
3628
+ border: 1px solid var(--surface-stroke-out);
3629
+ border-radius: var(--radius);
3630
+ box-shadow: var(--shadow-lg);
3631
+ transition: height 120ms var(--deceleration-curve);
3632
+ }
3633
+
3634
+ .command-palette-search {
3635
+ display: flex;
3636
+ height: 54px;
3637
+ padding: 0 18px;
3638
+ align-items: center;
3639
+ flex-shrink: 0;
3640
+ gap: 12px;
3641
+ border-bottom: 1px solid var(--gray-100);
3642
+ }
3643
+
3644
+ .command-palette-search-icon {
3645
+ flex-shrink: 0;
3646
+ color: var(--foreground-secondary);
3647
+ font-size: 16px;
3648
+ }
3649
+
3650
+ .command-palette-search-input {
3651
+ height: 100%;
3652
+ flex-grow: 1;
3653
+ background: transparent;
3654
+ border: 0;
3655
+ color: var(--foreground);
3656
+ font: inherit;
3657
+ font-size: 16px;
3658
+ outline: 0;
3659
+ }
3660
+ .command-palette-search-input::placeholder {
3661
+ color: var(--foreground-secondary);
3662
+ }
3663
+
3664
+ .command-palette-breadcrumb {
3665
+ padding: 0;
3666
+ flex-shrink: 0;
3667
+ background: transparent;
3668
+ border: 0;
3669
+ cursor: pointer;
3670
+ color: var(--foreground-secondary);
3671
+ font: inherit;
3672
+ font-size: 15px;
3673
+ font-weight: 500;
3674
+ white-space: nowrap;
3675
+ transition: color 150ms;
3676
+ }
3677
+ @media (hover: hover) {
3678
+ .command-palette-breadcrumb:hover {
3679
+ color: var(--foreground);
3680
+ }
3681
+ }
3682
+
3683
+ .command-palette-breadcrumb-separator {
3684
+ flex-shrink: 0;
3685
+ opacity: 0.5;
3686
+ color: var(--foreground-secondary);
3687
+ font-size: 14px;
3688
+ }
3689
+
3690
+ .command-palette-tabs {
3691
+ display: flex;
3692
+ overflow-x: auto;
3693
+ scrollbar-width: none;
3694
+ padding: 6px 15px;
3695
+ flex-shrink: 0;
3696
+ gap: 3px;
3697
+ border-bottom: 1px solid var(--gray-100);
3698
+ }
3699
+ .command-palette-tabs::-webkit-scrollbar {
3700
+ display: none;
3701
+ }
3702
+
3703
+ .command-palette-tab {
3704
+ display: flex;
3705
+ height: 30px;
3706
+ padding: 0 10px;
3707
+ align-items: center;
3708
+ gap: 6px;
3709
+ background: transparent;
3710
+ border: 0;
3711
+ border-radius: var(--radius-half);
3712
+ cursor: pointer;
3713
+ color: var(--foreground-secondary);
3714
+ font: inherit;
3715
+ font-size: 13px;
3716
+ font-weight: 500;
3717
+ white-space: nowrap;
3718
+ transition: background 150ms, color 150ms;
3719
+ }
3720
+ @media (hover: hover) {
3721
+ .command-palette-tab:hover {
3722
+ background: var(--gray-100);
3723
+ color: var(--foreground);
3724
+ }
3725
+ }
3726
+
3727
+ .command-palette-tab-active {
3728
+ background: var(--primary-100);
3729
+ color: var(--primary-700);
3730
+ }
3731
+ @media (hover: hover) {
3732
+ .command-palette-tab-active:hover {
3733
+ background: var(--primary-100);
3734
+ color: var(--primary-700);
3735
+ }
3736
+ }
3737
+
3738
+ .command-palette-tab-icon {
3739
+ font-size: 13px;
3740
+ }
3741
+
3742
+ .command-palette-results {
3743
+ overflow-y: auto;
3744
+ overscroll-behavior: contain;
3745
+ scroll-padding-block: 42px 6px;
3746
+ scrollbar-width: thin;
3747
+ padding: 6px;
3748
+ flex-grow: 1;
3749
+ }
3750
+
3751
+ .command-palette-loading {
3752
+ display: flex;
3753
+ padding: 24px;
3754
+ align-items: center;
3755
+ justify-content: center;
3756
+ }
3757
+
3758
+ .command-palette-empty {
3759
+ display: flex;
3760
+ padding: 24px;
3761
+ align-items: center;
3762
+ justify-content: center;
3763
+ color: var(--foreground-secondary);
3764
+ font-size: 14px;
3765
+ }
3766
+
3767
+ .command-palette-group {
3768
+ display: flex;
3769
+ padding: 9px 10px 3px;
3770
+ align-items: center;
3771
+ gap: 6px;
3772
+ color: var(--foreground-secondary);
3773
+ font-size: 12px;
3774
+ font-weight: 600;
3775
+ text-transform: uppercase;
3776
+ letter-spacing: 0.05em;
3777
+ pointer-events: none;
3778
+ }
3779
+
3780
+ .command-palette-group-icon {
3781
+ font-size: 12px;
3782
+ }
3783
+
3784
+ .command-palette-item {
3785
+ display: flex;
3786
+ width: 100%;
3787
+ padding: 8px 10px;
3788
+ align-items: center;
3789
+ gap: 10px;
3790
+ background: transparent;
3791
+ border: 0;
3792
+ border-radius: var(--radius-half);
3793
+ cursor: pointer;
3794
+ color: var(--foreground);
3795
+ font: inherit;
3796
+ font-size: 14px;
3797
+ text-align: left;
3798
+ transition: background 100ms;
3799
+ }
3800
+ @media (hover: hover) {
3801
+ .command-palette-item:hover {
3802
+ background: var(--gray-100);
3803
+ }
3804
+ }
3805
+ .command-palette-item:active {
3806
+ background: var(--gray-200);
3807
+ }
3808
+
3809
+ .command-palette-item-highlighted {
3810
+ background: var(--gray-100);
3811
+ }
3812
+ @media (hover: hover) {
3813
+ .command-palette-item-highlighted:hover {
3814
+ background: var(--gray-100);
3815
+ }
3816
+ }
3817
+
3818
+ .command-palette-item-icon {
3819
+ display: flex;
3820
+ width: 30px;
3821
+ height: 30px;
3822
+ align-items: center;
3823
+ align-self: flex-start;
3824
+ flex-shrink: 0;
3825
+ justify-content: center;
3826
+ background: var(--gray-100);
3827
+ border-radius: var(--radius-half);
3828
+ color: var(--foreground);
3829
+ transition: background 100ms, color 100ms;
3830
+ }
3831
+ .command-palette-item-icon .icon {
3832
+ font-size: 16px;
3833
+ }
3834
+
3835
+ .command-palette-item-highlighted .command-palette-item-icon {
3836
+ background: var(--gray-200);
3837
+ }
3838
+
3839
+ .command-palette-item-content {
3840
+ overflow: hidden;
3841
+ flex-grow: 1;
3842
+ }
3843
+
3844
+ .command-palette-item-label {
3845
+ overflow: hidden;
3846
+ white-space: nowrap;
3847
+ text-overflow: ellipsis;
3848
+ }
3849
+
3850
+ .command-palette-item-sub-label {
3851
+ overflow: hidden;
3852
+ margin-top: 1px;
3853
+ color: var(--foreground-secondary);
3854
+ font-size: 12px;
3855
+ white-space: nowrap;
3856
+ text-overflow: ellipsis;
3857
+ transition: color 100ms;
3858
+ }
3859
+
3860
+ .command-palette-item-highlighted .command-palette-item-sub-label {
3861
+ color: var(--primary-500);
3862
+ }
3863
+
3864
+ .command-palette-item-sub-action-indicator {
3865
+ flex-shrink: 0;
3866
+ color: var(--foreground-secondary);
3867
+ font-size: 12px;
3868
+ transition: color 100ms;
3869
+ }
3870
+
3871
+ .command-palette-item-highlighted .command-palette-item-sub-action-indicator {
3872
+ color: var(--primary-500);
3873
+ }
3874
+
3875
+ @keyframes command-palette-in {
3876
+ from {
3877
+ opacity: 0;
3878
+ scale: 1.05;
3879
+ }
3880
+ to {
3881
+ opacity: 1;
3882
+ scale: 1;
3883
+ }
3884
+ }
3885
+ @keyframes command-palette-out {
3886
+ from {
3887
+ opacity: 1;
3888
+ }
3889
+ to {
3890
+ opacity: 0;
3891
+ }
3892
+ }
3893
+ @keyframes command-palette-backdrop-in {
3894
+ from {
3895
+ opacity: 0;
3896
+ }
3897
+ to {
3898
+ opacity: 1;
3899
+ }
3900
+ }
3901
+ @keyframes command-palette-backdrop-out {
3902
+ from {
3903
+ opacity: 1;
3904
+ }
3905
+ to {
3906
+ opacity: 0;
3907
+ }
3588
3908
  }.comment {
3589
3909
  display: grid;
3590
3910
  max-width: 100%;