Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/unlucky-tables-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cube-dev/ui-kit": minor
---

Allow to set cursorStrategy to `web` or `native` in Root component.
2 changes: 1 addition & 1 deletion src/components/HiddenInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const HiddenInput = tasty({
height: '100%',
cursor: {
'': 'default',
button: 'pointer',
button: '$pointer',
disabled: 'not-allowed',
},
},
Expand Down
4 changes: 3 additions & 1 deletion src/components/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { PortalProvider } from './portal';

const RootElement = tasty({
id: 'cube-ui-kit-root',
// className: 'root',
});

const DEFAULT_STYLES = {
Expand All @@ -49,6 +48,7 @@ export interface CubeRootProps extends BaseProps {
monospaceFont?: string;
applyLegacyTokens?: boolean;
tracking?: TrackingProps;
cursorStrategy?: 'web' | 'native';
}

const IS_DVH_SUPPORTED =
Expand All @@ -70,6 +70,7 @@ export function Root(allProps: CubeRootProps) {
monospaceFont,
applyLegacyTokens,
tracking,
cursorStrategy = 'web',
style,
...props
} = allProps;
Expand Down Expand Up @@ -138,6 +139,7 @@ export function Root(allProps: CubeRootProps) {
'--cube-dynamic-viewport-height': height
? height + 'px'
: '100dvh',
'--pointer': cursorStrategy === 'web' ? 'pointer' : 'default',
...style,
}}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/actions/Action/Action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ActionElement = tasty({
padding: 0,
outline: 0,
transition: 'theme',
cursor: 'pointer',
cursor: '$pointer',
textDecoration: 'none',
fill: '#clear',
},
Expand Down
6 changes: 4 additions & 2 deletions src/components/actions/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ export const DEFAULT_BUTTON_STYLES = {
margin: 0,
boxSizing: 'border-box',
cursor: {
'': 'pointer',
disabled: 'default',
'': 'default',
':is(a)': 'pointer',
':is(button)': '$pointer',
disabled: 'not-allowed',
},
gap: {
'': '.75x',
Expand Down
2 changes: 1 addition & 1 deletion src/components/actions/ItemAction/ItemAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const ItemActionElement = tasty({
reset: 'button',
outline: 0,
outlineOffset: 1,
cursor: { '': 'pointer', disabled: 'default' },
cursor: { '': '$pointer', disabled: 'default' },
padding: {
'': '0 $inline-padding',
'with-icon': 0,
Expand Down
2 changes: 1 addition & 1 deletion src/components/content/CopyPasteBlock/CopyPasteBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const CopyPasteBlockElement = tasty(Card, {
':focus': '2px dashed #purple-text',
error: 'dashed #danger',
},
cursor: 'pointer',
cursor: '$pointer',
preset: {
'': 't3',
'[data-size="large"]': 't2',
Expand Down
3 changes: 2 additions & 1 deletion src/components/content/Item/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ const ItemElement = tasty({
outlineOffset: 1,
cursor: {
'': 'default',
':is(button) | :is(a)': 'pointer',
':is(a)': 'pointer',
':is(button) | listboxitem | menuitem': '$pointer',
disabled: 'not-allowed',
},

Expand Down
2 changes: 1 addition & 1 deletion src/components/fields/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const CheckboxWrapperElement = tasty({
gap: '1x',
flow: 'row',
preset: 'default',
cursor: 'pointer',
cursor: '$pointer',
width: 'max max-content',
color: '#dark-02',
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/fields/FileInput/FileInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const FileInputElement = tasty(Action, {
},
border: true,
radius: true,
cursor: 'pointer',
cursor: '$pointer',
overflow: 'hidden',
whiteSpace: 'nowrap',

Expand Down Expand Up @@ -91,7 +91,7 @@ const FileInputElement = tasty(Action, {
left: 0,
radius: '$content-radius',
opacity: 0.01,
cursor: 'pointer',
cursor: '$pointer',
zIndex: 10,
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/fields/ListBox/ListBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ const ListBoxCheckboxWrapper = tasty({
display: 'grid',
placeItems: 'center',
placeContent: 'center',
cursor: 'pointer',
cursor: '$pointer',
placeSelf: 'stretch',
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/fields/Slider/elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const SliderThumbElement = tasty({
dragged: '#purple',
disabled: '#dark-04',
},
cursor: 'pointer',
cursor: '$pointer',
outline: {
'': '#purple-text.0',
focused: '1bw #purple-text',
Expand Down
4 changes: 2 additions & 2 deletions src/components/fields/Switch/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const SwitchElement = tasty({
},
outlineOffset: 1,
transition: 'theme',
cursor: 'pointer',
cursor: '$pointer',

Thumb: {
position: 'absolute',
Expand Down Expand Up @@ -116,7 +116,7 @@ const SwitchElement = tasty({
'checked & [data-size="small"]': '1.25x',
},
transition: 'left, theme',
cursor: 'pointer',
cursor: '$pointer',
},
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/FileTabs/FileTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const TabElement = tasty(Action, {
'disabled, hovered, hovered & disabled': '#dark',
},
cursor: {
'': 'pointer',
'': '$pointer',
disabled: 'default',
},
fontWeight: 500,
Expand Down
4 changes: 2 additions & 2 deletions src/components/other/Base64Upload/Base64Upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const Base64Upload = styled(
}),
)`
appearance: none;
cursor: pointer;
cursor: var(--pointer);
outline: none;

& input {
Expand All @@ -132,7 +132,7 @@ export const Base64Upload = styled(
bottom: 0;
left: 0;
opacity: 0;
cursor: pointer;
cursor: var(--pointer);
width: 100%;
height: 100%;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/other/Calendar/CalendarCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const CalendarButtonElement = tasty({
},
outlineOffset: 0.5,
radius: true,
cursor: 'pointer',
cursor: '$pointer',
},
});

Expand Down
4 changes: 2 additions & 2 deletions src/components/overlays/Tooltip/Tooltip.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const FunctionPatternTemplate: Story<CubeTooltipProviderProps> = (args) => (
padding: '8px 16px',
border: '2px solid #007acc',
borderRadius: '4px',
cursor: 'pointer',
cursor: '$pointer',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Inline styles: replace $pointer with CSS var(--pointer)

The cursor property in React inline styles uses the $pointer token, which is specific to the tasty styling system. For standard inline styles, CSS custom properties need to be referenced using var(--pointer).

Additional Locations (1)

Fix in Cursor Fix in Web

display: 'inline-block',
backgroundColor: '#f0f8ff',
color: '#333',
Expand Down Expand Up @@ -154,7 +154,7 @@ const DirectFunctionPatternTemplate: Story<CubeTooltipTriggerProps> = (
padding: '4px 8px',
border: '1px solid #ff6b6b',
borderRadius: '4px',
cursor: 'pointer',
cursor: '$pointer',
display: 'inline-block',
backgroundColor: '#ffe0e0',
}}
Expand Down
2 changes: 1 addition & 1 deletion src/stories/CreateComponent.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ const DEFAULT_ACTION_STYLES: Styles = {
focused: '#purple-03',
},
transition: 'theme',
cursor: 'pointer',
cursor: '$pointer',
textDecoration: 'none',
fill: '#clear',
} as const;
Expand Down