|
1 | 1 | import {themeVars} from '@codeimage/ui'; |
2 | | -import {style} from '@vanilla-extract/css'; |
| 2 | +import {componentStateStyles} from '@kobalte/vanilla-extract'; |
| 3 | +import {keyframes, style} from '@vanilla-extract/css'; |
3 | 4 |
|
4 | | -export const tabHint = style({ |
5 | | - position: 'absolute', |
6 | | - backgroundColor: themeVars.dynamicColors.dialog.panelBackgroundColor, |
7 | | - boxShadow: themeVars.dynamicColors.dialog.panelShadow, |
8 | | - borderRadius: themeVars.borderRadius.lg, |
9 | | - zIndex: themeVars.zIndex['50'], |
10 | | - maxHeight: '250px', |
11 | | - overflowY: 'auto', |
12 | | - left: 0, |
13 | | - transition: 'all 100ms ease-in-out', |
| 5 | +const contentShow = keyframes({ |
| 6 | + from: { |
| 7 | + opacity: 0, |
| 8 | + transform: 'translateY(-8px)', |
| 9 | + }, |
| 10 | + to: { |
| 11 | + opacity: 1, |
| 12 | + transform: 'translateY(0)', |
| 13 | + }, |
14 | 14 | }); |
15 | 15 |
|
16 | | -export const tabHintDropdownOption = style({ |
17 | | - outline: 'none', |
18 | | - ':focus': { |
19 | | - outline: 'none', |
| 16 | +const contentHide = keyframes({ |
| 17 | + from: { |
| 18 | + opacity: 1, |
| 19 | + transform: 'translateY(0px)', |
20 | 20 | }, |
21 | | - ':focus-visible': { |
22 | | - outline: 'none', |
| 21 | + to: { |
| 22 | + opacity: 0, |
| 23 | + transform: 'translateY(-0)', |
23 | 24 | }, |
24 | 25 | }); |
25 | 26 |
|
26 | | -export const tabHintDropdownItemContent = style({ |
27 | | - height: '32px', |
28 | | - fontWeight: themeVars.fontWeight.normal, |
29 | | - fontSize: themeVars.fontSize.sm, |
30 | | - display: 'flex', |
31 | | - alignItems: 'center', |
32 | | - padding: `0 ${themeVars.spacing['3']}`, |
33 | | - borderBottom: `1px solid ${themeVars.dynamicColors.divider}`, |
34 | | - color: themeVars.dynamicColors.listBox.textColor, |
35 | | - whiteSpace: 'nowrap', |
36 | | - cursor: 'pointer', |
37 | | - vars: { |
38 | | - ['--highlight-color']: 'rgb(112, 182, 246, 0.25)', |
| 27 | +export const tabHint = style([ |
| 28 | + { |
| 29 | + position: 'absolute', |
| 30 | + backgroundColor: themeVars.dynamicColors.dialog.panelBackgroundColor, |
| 31 | + boxShadow: themeVars.dynamicColors.dialog.panelShadow, |
| 32 | + borderRadius: themeVars.borderRadius.lg, |
| 33 | + zIndex: themeVars.zIndex['50'], |
| 34 | + maxHeight: '250px', |
| 35 | + overflowY: 'auto', |
| 36 | + left: 0, |
| 37 | + transition: 'all 200ms ease-in-out', |
| 38 | + transformOrigin: 'var(--kb-combobox-content-transform-origin)', |
| 39 | + animation: `${contentHide} 150ms ease-in forwards`, |
39 | 40 | }, |
40 | | - ':hover': { |
41 | | - backgroundColor: themeVars.dynamicColors.listBox.hoverBackgroundColor, |
| 41 | + componentStateStyles({ |
| 42 | + expanded: { |
| 43 | + animation: `${contentShow} 150ms ease-out`, |
| 44 | + }, |
| 45 | + }), |
| 46 | +]); |
| 47 | + |
| 48 | +export const listbox = style({ |
| 49 | + display: 'flex', |
| 50 | + flexDirection: 'column', |
| 51 | + maxHeight: '250px', |
| 52 | + overflowY: 'auto', |
| 53 | + overflowX: 'hidden', |
| 54 | +}); |
| 55 | + |
| 56 | +export const tabHintDropdownItemContent = style([ |
| 57 | + { |
| 58 | + height: '34px', |
| 59 | + flex: '1 0 34px', |
| 60 | + fontWeight: themeVars.fontWeight.normal, |
| 61 | + fontSize: themeVars.fontSize.sm, |
| 62 | + display: 'flex', |
| 63 | + alignItems: 'center', |
| 64 | + padding: `0 ${themeVars.spacing['3']}`, |
| 65 | + borderBottom: `1px solid ${themeVars.dynamicColors.divider}`, |
42 | 66 | color: themeVars.dynamicColors.listBox.textColor, |
43 | | - }, |
44 | | - selectors: { |
45 | | - ['[active] &']: { |
46 | | - backgroundColor: themeVars.dynamicColors.listBox.activeBackgroundColor, |
47 | | - color: themeVars.dynamicColors.listBox.activeTextColor, |
| 67 | + whiteSpace: 'nowrap', |
| 68 | + cursor: 'pointer', |
| 69 | + vars: { |
| 70 | + ['--highlight-color']: 'rgb(112, 182, 246, 0.25)', |
| 71 | + }, |
| 72 | + ':hover': { |
| 73 | + backgroundColor: themeVars.dynamicColors.listBox.hoverBackgroundColor, |
| 74 | + color: themeVars.dynamicColors.listBox.textColor, |
| 75 | + }, |
| 76 | + selectors: { |
| 77 | + ['[active] &']: { |
| 78 | + backgroundColor: themeVars.dynamicColors.listBox.activeBackgroundColor, |
| 79 | + color: themeVars.dynamicColors.listBox.activeTextColor, |
| 80 | + }, |
| 81 | + ['[aria-selected=true] &']: { |
| 82 | + backgroundColor: themeVars.dynamicColors.listBox.activeBackgroundColor, |
| 83 | + color: themeVars.dynamicColors.listBox.activeTextColor, |
| 84 | + }, |
48 | 85 | }, |
49 | | - ['[aria-selected=true] &']: { |
| 86 | + }, |
| 87 | + componentStateStyles({ |
| 88 | + highlighted: { |
50 | 89 | backgroundColor: themeVars.dynamicColors.listBox.activeBackgroundColor, |
51 | 90 | color: themeVars.dynamicColors.listBox.activeTextColor, |
52 | 91 | }, |
53 | | - }, |
| 92 | + }), |
| 93 | +]); |
| 94 | + |
| 95 | +export const tabHintDropdownItemLabel = style({ |
| 96 | + display: 'flex', |
| 97 | + alignItems: 'center', |
54 | 98 | }); |
55 | 99 |
|
56 | 100 | export const tabText = style([ |
57 | 101 | { |
58 | 102 | display: 'inline-block', |
59 | 103 | }, |
60 | 104 | ]); |
| 105 | + |
| 106 | +export const control = style({}); |
| 107 | + |
| 108 | +export const inlineHiddenItem = style({ |
| 109 | + visibility: 'hidden', |
| 110 | + display: 'inline-block', |
| 111 | + height: 0, |
| 112 | + left: 0, |
| 113 | + position: 'absolute', |
| 114 | + whiteSpace: 'nowrap', |
| 115 | + wordBreak: 'keep-all', |
| 116 | +}); |
| 117 | + |
| 118 | +export const input = style({ |
| 119 | + backgroundColor: 'transparent', |
| 120 | + color: 'inherit', |
| 121 | + appearance: 'none', |
| 122 | + outline: 'none', |
| 123 | + padding: 0, |
| 124 | + margin: 0, |
| 125 | + border: 'none', |
| 126 | +}); |
0 commit comments