Skip to content

Commit c5357a7

Browse files
authored
chore: update tasty (#1107)
1 parent 9401dea commit c5357a7

23 files changed

Lines changed: 61 additions & 63 deletions

.changeset/upgrade-tasty-1-1-0.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@cube-dev/ui-kit': minor
3+
---
4+
5+
Upgrade `@tenphi/tasty` from 0.15.3 to 1.1.0.
6+
7+
**Breaking changes:**
8+
9+
- Font CSS custom properties renamed: `--font``--font-sans`, `--monospace-font``--font-mono`
10+
- Preset modifier syntax now uses `/` separator (e.g., `'t3 / strong'` instead of `'t3 strong'`)
11+
- Removed standalone `strong` and `em` typography presets (use modifiers instead: `'inherit / bold'`, `'inherit / italic'`)
12+
- The `1fs` unit is no longer supported; replaced with `1em`

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"@react-types/shared": "^3.32.1",
7575
"@tabler/icons-react": "^3.31.0",
7676
"@tanstack/react-virtual": "^3.13.12",
77-
"@tenphi/tasty": "0.15.3",
77+
"@tenphi/tasty": "1.1.0",
7878
"clipboard-copy": "^4.0.1",
7979
"clsx": "^1.1.1",
8080
"diff": "^8.0.3",
@@ -111,7 +111,7 @@
111111
"@statoscope/cli": "^5.20.1",
112112
"@storybook/addon-docs": "^10.2.3",
113113
"@storybook/react-vite": "^10.2.3",
114-
"@tenphi/eslint-plugin-tasty": "^0.3.1",
114+
"@tenphi/eslint-plugin-tasty": "^0.6.2",
115115
"@testing-library/dom": "^10.4.1",
116116
"@testing-library/jest-dom": "^6.7.0",
117117
"@testing-library/react": "^16.3.0",

pnpm-lock.yaml

Lines changed: 12 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/GlobalStyles.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface GlobalStylesProps {
2323
const BODY_STYLES: Styles = {
2424
overscrollBehaviorY: 'none',
2525
fill: '#white',
26-
fontFamily: 'var(--font)',
26+
fontFamily: 'var(--font-sans)',
2727
'-webkit-font-smoothing': 'antialiased',
2828
'-moz-osx-font-smoothing': 'grayscale',
2929
margin: 0,
@@ -83,15 +83,15 @@ const STATIC_CSS = `
8383
}
8484
8585
code {
86-
font-family: var(--monospace-font);
86+
font-family: var(--font-mono);
8787
}
8888
8989
/* Prism Code */
9090
code[class*="language-"],
9191
pre[class*="language-"] {
9292
color: var(--dark-color);
9393
background: none;
94-
font-family: var(--monospace-font);
94+
font-family: var(--font-mono);
9595
text-align: left;
9696
font-weight: normal;
9797
font-size: 14px;
@@ -276,8 +276,8 @@ export function GlobalStyles(props: GlobalStylesProps) {
276276
return `
277277
html {
278278
overscroll-behavior-y: none;
279-
--font: ${fontValue}system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
280-
--monospace-font: ${monospaceFontValue}ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
279+
--font-sans: ${fontValue}system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
280+
--font-mono: ${monospaceFontValue}ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
281281
}
282282
${STATIC_CSS}`;
283283
}, [font, monospaceFont]);

src/components/content/ItemBadge/ItemBadge.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BaseProps, tasty } from '@tenphi/tasty';
1+
import { BaseProps, mergeStyles, tasty } from '@tenphi/tasty';
22
import {
33
ComponentProps,
44
forwardRef,
@@ -67,14 +67,13 @@ type ItemBadgeVariant =
6767

6868
const ItemBadgeElement = tasty({
6969
qa: 'ItemBadge',
70-
styles: {
71-
...ITEM_ACTION_BASE_STYLES,
70+
styles: mergeStyles(ITEM_ACTION_BASE_STYLES, {
7271
cursor: 'default',
7372
border: {
7473
// extend
7574
'type=primary': '#clear',
7675
},
77-
},
76+
}),
7877
variants: {
7978
// Default theme
8079
'default.primary': DEFAULT_PRIMARY_STYLES,

src/components/content/Layout/Layout.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,8 +1210,8 @@ export const OverlayPanel: Story = {
12101210
* The overlay backdrop can be customized using the `overlayStyles` prop.
12111211
* This example shows a darker overlay with custom fill color.
12121212
*/
1213-
export const OverlayPanelCustomStyles: Story = {
1214-
render: function OverlayPanelCustomStylesStory() {
1213+
export const OverlayPanelCustomStyling: Story = {
1214+
render: function OverlayPanelCustomStylingStory() {
12151215
const [isPanelOpen, setIsPanelOpen] = useState(true);
12161216

12171217
return (

src/components/content/Layout/LayoutHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const HeaderElement = tasty(LayoutContent, {
5656
flow: 'row nowrap',
5757
placeItems: 'center start',
5858
gap: '1bw',
59-
preset: 't3 strong',
59+
preset: 't3 / strong',
6060
color: '#dark-02',
6161
},
6262

src/components/content/Layout/LayoutPanel.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ const PanelElement = tasty({
9999

100100
// Visual styling
101101
border: {
102+
'': false,
102103
'side=left': 'right',
103104
'side=right': 'left',
104105
'side=top': 'bottom',
@@ -163,6 +164,7 @@ const ResizeHandlerElement = tasty({
163164

164165
// Offscreen transforms only (no centering needed with direct offset positioning)
165166
transform: {
167+
'': 'translateX(0)',
166168
'offscreen & side=left': `translateX(calc(-1 * $panel-size - ${HANDLER_WIDTH - HANDLER_OFFSET}px))`,
167169
'offscreen & side=right': `translateX(calc($panel-size + ${HANDLER_WIDTH - HANDLER_OFFSET}px))`,
168170
'offscreen & side=top': `translateY(calc(-1 * $panel-size - ${HANDLER_WIDTH - HANDLER_OFFSET}px))`,

src/components/content/Tag/Tag.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export const Sizes: Story = {
228228
),
229229
};
230230

231-
export const CustomStyles: Story = {
231+
export const CustomStyling: Story = {
232232
args: {
233233
children: 'Custom Tag',
234234
styles: {

src/components/content/Text.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const StrongText = tasty(Text, {
131131

132132
const EmphasisText = tasty(Text, {
133133
as: 'em',
134-
preset: 'em',
134+
preset: 'italic',
135135
});
136136

137137
const PlaceholderText = tasty(Text, {

0 commit comments

Comments
 (0)