Skip to content

Commit 9431107

Browse files
committed
Merge remote-tracking branch 'origin' into refactor-padding-margin-styles
2 parents 80e4d7d + 43e31a6 commit 9431107

File tree

91 files changed

+6873
-3306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+6873
-3306
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ yarn-error.log
1616
coverage
1717
size-limit-report/stats.json
1818
docs-static
19-
19+
*.plan.md

.size-limit.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ module.exports = [
2020
}),
2121
);
2222
},
23-
limit: '305kB',
23+
limit: '310kB',
2424
},
2525
{
2626
name: 'Tree shaking (just a Button)',
2727
path: './dist/es/index.js',
2828
webpack: true,
2929
import: '{ Button }',
30-
limit: '32 kB',
30+
limit: '33 kB',
3131
},
3232
{
3333
name: 'Tree shaking (just an Icon)',
3434
path: './dist/es/index.js',
3535
webpack: true,
3636
import: '{ AiIcon }',
37-
limit: '19 kB',
37+
limit: '20 kB',
3838
},
3939
];

.storybook/preview.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ configure({ testIdAttribute: 'data-qa', asyncUtilTimeout: 10000 });
88

99
// Load tasty debug utilities in local Storybook only (exclude Chromatic)
1010
if (!isChromatic() && import.meta.env.DEV) {
11-
import('../src/tasty/debug').then(({ installGlobalDebug }) => {
11+
import('../src/tasty/debug').then(({ tastyDebug }) => {
1212
try {
13-
installGlobalDebug({ force: true });
13+
tastyDebug.install();
1414
} catch (e) {
1515
console.warn('tastyDebug installation failed:', e);
1616
}

CHANGELOG.md

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,190 @@
11
# @cube-dev/ui-kit
22

3+
## 0.80.1
4+
5+
### Patch Changes
6+
7+
- [#812](https://github.com/cube-js/cube-ui-kit/pull/812) [`4c673561`](https://github.com/cube-js/cube-ui-kit/commit/4c6735617a7ac754c0b3e4b0c7871c759ceeea48) Thanks [@tenphi](https://github.com/tenphi)! - Fix tooltip dynamic calculation in ItemBase.
8+
9+
- [#813](https://github.com/cube-js/cube-ui-kit/pull/813) [`96218a6e`](https://github.com/cube-js/cube-ui-kit/commit/96218a6ef18ce24307269f36657fc8209aea68cc) Thanks [@tenphi](https://github.com/tenphi)! - Add ChartHeatmapIcon component.
10+
11+
## 0.80.0
12+
13+
### Minor Changes
14+
15+
- [#810](https://github.com/cube-js/cube-ui-kit/pull/810) [`eb5a2efa`](https://github.com/cube-js/cube-ui-kit/commit/eb5a2efad5681c7f38e5beb6852249e222fd9efa) Thanks [@tenphi](https://github.com/tenphi)! - Add new icons: PercentageIcon, CurrencyDollarIcon, Number123Icon.
16+
17+
### Patch Changes
18+
19+
- [#809](https://github.com/cube-js/cube-ui-kit/pull/809) [`041e7da7`](https://github.com/cube-js/cube-ui-kit/commit/041e7da7be5a293c7919a49f23c758215fe67999) Thanks [@tenphi](https://github.com/tenphi)! - Fix tooltip logic in ItemBase component.
20+
21+
- [#809](https://github.com/cube-js/cube-ui-kit/pull/809) [`041e7da7`](https://github.com/cube-js/cube-ui-kit/commit/041e7da7be5a293c7919a49f23c758215fe67999) Thanks [@tenphi](https://github.com/tenphi)! - Fix accessibility by setting keyboard props to hotkeys in ItemBase component.
22+
23+
## 0.79.0
24+
25+
### Minor Changes
26+
27+
- [#807](https://github.com/cube-js/cube-ui-kit/pull/807) [`ce19c264`](https://github.com/cube-js/cube-ui-kit/commit/ce19c26496fbb87799fc7fb055d1647a4f87c392) Thanks [@tenphi](https://github.com/tenphi)! - **Breaking Change:** AlertDialog API cancel button behavior changed
28+
29+
The `cancel` button in AlertDialog now rejects the promise instead of resolving with `'cancel'` status, aligning it with the dismiss (Escape key) behavior.
30+
31+
**Migration Guide:**
32+
33+
**Before:**
34+
35+
```typescript
36+
alertDialogAPI.open({...})
37+
.then((status) => {
38+
if (status === 'cancel') {
39+
// Handle cancel
40+
} else if (status === 'confirm') {
41+
// Handle confirm
42+
}
43+
})
44+
```
45+
46+
**After:**
47+
48+
```typescript
49+
alertDialogAPI.open({...})
50+
.then((status) => {
51+
if (status === 'confirm') {
52+
// Handle confirm
53+
} else if (status === 'secondary') {
54+
// Handle secondary action
55+
}
56+
})
57+
.catch(() => {
58+
// Handle cancel or dismiss
59+
})
60+
```
61+
62+
**Note:** `AlertDialogResolveStatus` type no longer includes `'cancel'` - it now only contains `'confirm' | 'secondary'`.
63+
64+
## 0.78.5
65+
66+
### Patch Changes
67+
68+
- [#805](https://github.com/cube-js/cube-ui-kit/pull/805) [`5fa85184`](https://github.com/cube-js/cube-ui-kit/commit/5fa851840db023def82f1a3838576ba8fe0d65f8) Thanks [@tenphi](https://github.com/tenphi)! - Fix the return type of the TooltipProvider the second time :)
69+
70+
- [#805](https://github.com/cube-js/cube-ui-kit/pull/805) [`5fa85184`](https://github.com/cube-js/cube-ui-kit/commit/5fa851840db023def82f1a3838576ba8fe0d65f8) Thanks [@tenphi](https://github.com/tenphi)! - Fix DecimalDecreaseIcon and DecimalIncreaseIcon.
71+
72+
## 0.78.4
73+
74+
### Patch Changes
75+
76+
- [#803](https://github.com/cube-js/cube-ui-kit/pull/803) [`a4f59bb7`](https://github.com/cube-js/cube-ui-kit/commit/a4f59bb74066d1e900fb69ab3215584182a38cb1) Thanks [@tenphi](https://github.com/tenphi)! - Fix the return type of the TooltipProvider the second time :)
77+
78+
## 0.78.3
79+
80+
### Patch Changes
81+
82+
- [#801](https://github.com/cube-js/cube-ui-kit/pull/801) [`fae98647`](https://github.com/cube-js/cube-ui-kit/commit/fae98647f070ac69f6fa7abc80b5bb568896c81a) Thanks [@tenphi](https://github.com/tenphi)! - Fix the return type of TooltipProvider.
83+
84+
## 0.78.2
85+
86+
### Patch Changes
87+
88+
- [#799](https://github.com/cube-js/cube-ui-kit/pull/799) [`29163467`](https://github.com/cube-js/cube-ui-kit/commit/29163467292aa161131735448ad5e1b659d55abc) Thanks [@tenphi](https://github.com/tenphi)! - Fix tooltip implementation so it doesn't break item navigation.
89+
90+
- [#799](https://github.com/cube-js/cube-ui-kit/pull/799) [`29163467`](https://github.com/cube-js/cube-ui-kit/commit/29163467292aa161131735448ad5e1b659d55abc) Thanks [@tenphi](https://github.com/tenphi)! - Use auto tooltip in ItemBase component by default. See documentation to learn more.
91+
92+
- [#798](https://github.com/cube-js/cube-ui-kit/pull/798) [`17e4f7f7`](https://github.com/cube-js/cube-ui-kit/commit/17e4f7f77103d9c2678cbe6e7c01ab2ca7aa7aa7) Thanks [@tenphi](https://github.com/tenphi)! - Don't pass onPress prop to the element in ItemButton.
93+
94+
## 0.78.1
95+
96+
### Patch Changes
97+
98+
- [#795](https://github.com/cube-js/cube-ui-kit/pull/795) [`2e1a331d`](https://github.com/cube-js/cube-ui-kit/commit/2e1a331d6a02c377e8b8017efe3109574bdde03d) Thanks [@tenphi](https://github.com/tenphi)! - Condense the UI of Dialog component.
99+
100+
- [#796](https://github.com/cube-js/cube-ui-kit/pull/796) [`728f983d`](https://github.com/cube-js/cube-ui-kit/commit/728f983d66a68e78c8c17f6edfde5b0e3b0050cb) Thanks [@tenphi](https://github.com/tenphi)! - Set `disabled`, `checked`, `hidden` mods automatically.
101+
102+
## 0.78.0
103+
104+
### Minor Changes
105+
106+
- [#793](https://github.com/cube-js/cube-ui-kit/pull/793) [`a64ee513`](https://github.com/cube-js/cube-ui-kit/commit/a64ee513381c56b470ebca720a6ad3f21bc5fd3f) Thanks [@tenphi](https://github.com/tenphi)! - The new navigation API that relies on external `useHref` and `useNavigation` hooks.
107+
108+
### Patch Changes
109+
110+
- [#793](https://github.com/cube-js/cube-ui-kit/pull/793) [`a64ee513`](https://github.com/cube-js/cube-ui-kit/commit/a64ee513381c56b470ebca720a6ad3f21bc5fd3f) Thanks [@tenphi](https://github.com/tenphi)! - Add support for full navigation argument type in `to` prop in actions including object `{ pathname, search, hash }` and numbers for history navigation. Use `<Link to={-1}>...` to move back in history.
111+
112+
## 0.77.4
113+
114+
### Patch Changes
115+
116+
- [#791](https://github.com/cube-js/cube-ui-kit/pull/791) [`1ca1deb4`](https://github.com/cube-js/cube-ui-kit/commit/1ca1deb4211ec6a67a5d81fbd7606a76c69faa31) Thanks [@tenphi](https://github.com/tenphi)! - Actualize the interface of Item component.
117+
118+
- [#791](https://github.com/cube-js/cube-ui-kit/pull/791) [`1ca1deb4`](https://github.com/cube-js/cube-ui-kit/commit/1ca1deb4211ec6a67a5d81fbd7606a76c69faa31) Thanks [@tenphi](https://github.com/tenphi)! - Make Panel placeSelf stretch by default.
119+
120+
- [#791](https://github.com/cube-js/cube-ui-kit/pull/791) [`1ca1deb4`](https://github.com/cube-js/cube-ui-kit/commit/1ca1deb4211ec6a67a5d81fbd7606a76c69faa31) Thanks [@tenphi](https://github.com/tenphi)! - Fix Item interface for FilterPicker.
121+
122+
- [#791](https://github.com/cube-js/cube-ui-kit/pull/791) [`1ca1deb4`](https://github.com/cube-js/cube-ui-kit/commit/1ca1deb4211ec6a67a5d81fbd7606a76c69faa31) Thanks [@tenphi](https://github.com/tenphi)! - Add onClear callback for FilterPicker, Select, ComboBox and SearchInput.
123+
124+
- [#791](https://github.com/cube-js/cube-ui-kit/pull/791) [`1ca1deb4`](https://github.com/cube-js/cube-ui-kit/commit/1ca1deb4211ec6a67a5d81fbd7606a76c69faa31) Thanks [@tenphi](https://github.com/tenphi)! - Fix popover of FilterPicker to corretly flip on opening.
125+
126+
## 0.77.3
127+
128+
### Patch Changes
129+
130+
- [#787](https://github.com/cube-js/cube-ui-kit/pull/787) [`78dc7da2`](https://github.com/cube-js/cube-ui-kit/commit/78dc7da2983d1acb1ed32ad48e482a62758c093c) Thanks [@tenphi](https://github.com/tenphi)! - Add ItemAction component with a temporary implementation.
131+
132+
- [#787](https://github.com/cube-js/cube-ui-kit/pull/787) [`78dc7da2`](https://github.com/cube-js/cube-ui-kit/commit/78dc7da2983d1acb1ed32ad48e482a62758c093c) Thanks [@tenphi](https://github.com/tenphi)! - Add a clear button to FilterPicker, Select and ComboBox components. Redesign the clear button in SearchInput component.
133+
134+
- [#789](https://github.com/cube-js/cube-ui-kit/pull/789) [`1251a11b`](https://github.com/cube-js/cube-ui-kit/commit/1251a11b7a406cf960ed1a89115c2f9dd4bd3717) Thanks [@tenphi](https://github.com/tenphi)! - Add DecimalDecreaseIcon.tsx and DecimalIncreaseIcon.tsx.
135+
136+
- [#790](https://github.com/cube-js/cube-ui-kit/pull/790) [`f4e502d1`](https://github.com/cube-js/cube-ui-kit/commit/f4e502d19eae89334c8f2487f7c0a4acb9c3fde6) Thanks [@tenphi](https://github.com/tenphi)! - Make toasts and notifications more visible with a colorful border.
137+
138+
## 0.77.2
139+
140+
### Patch Changes
141+
142+
- [#784](https://github.com/cube-js/cube-ui-kit/pull/784) [`39be6b6b`](https://github.com/cube-js/cube-ui-kit/commit/39be6b6b7053001a36939d047d91dd1ef3d67db5) Thanks [@tenphi](https://github.com/tenphi)! - Fix tooltip condition in ItemBase.
143+
144+
- [#784](https://github.com/cube-js/cube-ui-kit/pull/784) [`39be6b6b`](https://github.com/cube-js/cube-ui-kit/commit/39be6b6b7053001a36939d047d91dd1ef3d67db5) Thanks [@tenphi](https://github.com/tenphi)! - Allow to rewrite the tooltip title in ItemBase.
145+
146+
## 0.77.1
147+
148+
### Patch Changes
149+
150+
- [#782](https://github.com/cube-js/cube-ui-kit/pull/782) [`01192708`](https://github.com/cube-js/cube-ui-kit/commit/01192708383c0e03921020bdeb1d5b5e3f0bc9e7) Thanks [@tenphi](https://github.com/tenphi)! - Fix FilterPicker's tooltip typings.
151+
152+
## 0.77.0
153+
154+
### Minor Changes
155+
156+
- [#780](https://github.com/cube-js/cube-ui-kit/pull/780) [`88accef2`](https://github.com/cube-js/cube-ui-kit/commit/88accef2beaadbdf2c2758de0c3aa961f619a0ca) Thanks [@tenphi](https://github.com/tenphi)! - Remove legacy Modal component.
157+
158+
### Patch Changes
159+
160+
- [#780](https://github.com/cube-js/cube-ui-kit/pull/780) [`88accef2`](https://github.com/cube-js/cube-ui-kit/commit/88accef2beaadbdf2c2758de0c3aa961f619a0ca) Thanks [@tenphi](https://github.com/tenphi)! - Add side border radius to the header and the footer of the menus.
161+
162+
## 0.76.2
163+
164+
### Patch Changes
165+
166+
- [#778](https://github.com/cube-js/cube-ui-kit/pull/778) [`0be20c83`](https://github.com/cube-js/cube-ui-kit/commit/0be20c83f07ff92dd65ba984cb309cdc16166bec) Thanks [@tenphi](https://github.com/tenphi)! - Fix form submission by Enter key.
167+
168+
## 0.76.1
169+
170+
### Patch Changes
171+
172+
- [#776](https://github.com/cube-js/cube-ui-kit/pull/776) [`3f8be8e5`](https://github.com/cube-js/cube-ui-kit/commit/3f8be8e5435e1f6fdcaf0976e27e8a6a3de4890d) Thanks [@tenphi](https://github.com/tenphi)! - Fix CSS total size calculation in debug tools.
173+
174+
## 0.76.0
175+
176+
### Minor Changes
177+
178+
- [#773](https://github.com/cube-js/cube-ui-kit/pull/773) [`d79517e8`](https://github.com/cube-js/cube-ui-kit/commit/d79517e82614fe3fe7c4e0d388ec4ef96ad00c88) Thanks [@tenphi](https://github.com/tenphi)! - Improved debug tools with better DX and simpler API.
179+
180+
### Patch Changes
181+
182+
- [#773](https://github.com/cube-js/cube-ui-kit/pull/773) [`d79517e8`](https://github.com/cube-js/cube-ui-kit/commit/d79517e82614fe3fe7c4e0d388ec4ef96ad00c88) Thanks [@tenphi](https://github.com/tenphi)! - Fix cleanup of style in the new style injector.
183+
184+
- [#773](https://github.com/cube-js/cube-ui-kit/pull/773) [`d79517e8`](https://github.com/cube-js/cube-ui-kit/commit/d79517e82614fe3fe7c4e0d388ec4ef96ad00c88) Thanks [@tenphi](https://github.com/tenphi)! - Optimize rule generation by sorting in cache keys.
185+
186+
- [#773](https://github.com/cube-js/cube-ui-kit/pull/773) [`d79517e8`](https://github.com/cube-js/cube-ui-kit/commit/d79517e82614fe3fe7c4e0d388ec4ef96ad00c88) Thanks [@tenphi](https://github.com/tenphi)! - Improve cache cleanup logic and cache checks.
187+
3188
## 0.75.0
4189

5190
### Minor Changes

DOCUMENTATION_GUIDELINES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Our component documentation serves multiple purposes:
2222
Every component documentation file should follow this structure:
2323

2424
```mdx
25-
import { Meta, Canvas, Story, Controls } from '@storybook/blocks';
25+
import { Meta, Canvas, Story, Controls } from '@storybook/addon-docs/blocks';
2626
import { ComponentName } from './ComponentName';
2727
import * as ComponentStories from './ComponentName.stories';
2828

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cube-dev/ui-kit",
3-
"version": "0.75.0",
3+
"version": "0.80.1",
44
"type": "module",
55
"description": "UIKit for Cube Projects",
66
"repository": {
@@ -47,7 +47,8 @@
4747
"clear": "pnpm clear:dist && rimraf ./storybook-docs ./storybook-static ./node_modules/.cache",
4848
"clear:dist": "rimraf ./dist",
4949
"release": "pnpm build && changeset publish",
50-
"postinstall": "git config blame.ignoreRevsFile .git-blame-ignore-revs"
50+
"postinstall": "git config blame.ignoreRevsFile .git-blame-ignore-revs",
51+
"add-icons": "cd src/icons && node add-new-icon.js && pnpm fix"
5152
},
5253
"publishConfig": {
5354
"directory": "dist"

src/components/Item.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1-
import { ReactElement, ReactNode } from 'react';
1+
import { ReactElement } from 'react';
22
import { Item, ItemProps } from 'react-stately';
33

4-
import { Styles } from '../tasty';
4+
import { CubeItemBaseProps } from './content/ItemBase/ItemBase';
55

6-
export interface CubeItemProps<T> extends ItemProps<T> {
7-
qa?: string;
8-
description?: ReactNode;
9-
descriptionPlacement?: 'inline' | 'block' | 'auto';
10-
icon?: ReactNode | 'checkbox';
11-
prefix?: ReactNode;
12-
suffix?: ReactNode;
13-
rightIcon?: ReactNode;
14-
styles?: Styles;
6+
export interface CubeItemProps<T>
7+
extends ItemProps<T>,
8+
Omit<CubeItemBaseProps, 'children'> {
159
onAction?: () => void;
1610
wrapper?: (item: ReactElement) => ReactElement;
1711
[key: string]: any;
1812
}
1913

20-
const _Item = Item as unknown as <T>(props: CubeItemProps<T>) => ReactElement;
14+
const _Item = Item as <T>(props: CubeItemProps<T>) => ReactElement;
2115

2216
export { _Item as Item };

src/components/Root.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ModalProvider } from 'react-aria';
33
import { StyleSheetManager } from 'styled-components';
44

55
import { Provider } from '../provider';
6+
import { NavigationAdapter } from '../providers/navigation.types';
67
import { TrackingProps, TrackingProvider } from '../providers/TrackingProvider';
78
import {
89
BASE_STYLES,
@@ -43,7 +44,7 @@ export interface CubeRootProps extends BaseProps {
4344
fontDisplay?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
4445
fonts?: boolean;
4546
publicUrl?: string;
46-
router?: any;
47+
navigation?: NavigationAdapter;
4748
font?: string;
4849
monospaceFont?: string;
4950
applyLegacyTokens?: boolean;
@@ -64,7 +65,7 @@ export function Root(allProps: CubeRootProps) {
6465
fontDisplay = 'swap',
6566
fonts,
6667
publicUrl,
67-
router,
68+
navigation,
6869
font,
6970
monospaceFont,
7071
applyLegacyTokens,
@@ -125,7 +126,7 @@ export function Root(allProps: CubeRootProps) {
125126
const styles = extractStyles(props, STYLES, DEFAULT_STYLES);
126127

127128
return (
128-
<Provider router={router} root={rootRef} breakpoints={breakpoints}>
129+
<Provider navigation={navigation} root={rootRef} breakpoints={breakpoints}>
129130
<TrackingProvider event={tracking?.event}>
130131
<StyleSheetManager>
131132
<RootElement

src/components/actions/Action/Action.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ import {
88
CONTAINER_STYLES,
99
ContainerStyleProps,
1010
extractStyles,
11-
Styles,
1211
TagName,
1312
tasty,
1413
TEXT_STYLES,
1514
TextStyleProps,
1615
} from '../../../tasty';
17-
import { useAction } from '../use-action';
16+
import { NavigateArg, useAction } from '../use-action';
1817

1918
export interface CubeActionProps<
2019
T extends TagName = 'a' | 'button' | 'span' | 'div',
@@ -23,7 +22,7 @@ export interface CubeActionProps<
2322
ContainerStyleProps,
2423
TextStyleProps,
2524
Omit<AriaButtonProps, 'type'> {
26-
to?: string;
25+
to?: NavigateArg;
2726
label?: string;
2827
htmlType?: 'button' | 'submit' | 'reset' | undefined;
2928
download?: string;

src/components/actions/Button/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export const DEFAULT_BUTTON_STYLES = {
101101
boxSizing: 'border-box',
102102
cursor: {
103103
'': 'pointer',
104-
'[disabled] | disabled': 'default',
104+
disabled: 'default',
105105
},
106106
gap: {
107107
'': '.75x',

0 commit comments

Comments
 (0)