Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
61bd727
feat(CopySnippet): improve component
tenphi Dec 24, 2024
2a8a051
feat(CopySnippet): improve component * 2
tenphi Dec 25, 2024
165d6c1
feat: new form logic and components
tenphi Dec 25, 2024
168e25d
feat: new form logic and components * 2
tenphi Dec 25, 2024
d695962
feat: new form logic and components * 2
tenphi Dec 25, 2024
1031811
feat: new form logic and components * 3
tenphi Dec 25, 2024
b1106aa
fix: warnings and errors
tenphi Dec 25, 2024
78b8d8b
fix(Alert): pass base styles as props
tenphi Dec 25, 2024
9dba088
fix(Alert): pass base styles as props * 2
tenphi Dec 25, 2024
ae13a24
fix(CopySnippet): allow to change border radius
tenphi Dec 25, 2024
270c225
fix(CopySnippet): allow to change border radius * 2
tenphi Dec 25, 2024
dcac135
fix(Form): form buttons handle isDisable properly
tenphi Dec 25, 2024
e96fdae
fix(Form): form buttons handle isDisable properly * 2
tenphi Dec 25, 2024
7a89b11
fix(Form): form buttons handle isDisable properly * 3
tenphi Dec 26, 2024
24305d7
chore: fix tasty tests
tenphi Dec 26, 2024
457183e
chore: add deprecation warning
tenphi Dec 26, 2024
e0a7fd4
fix(ResizablePanel): update visual size when container resizes
tenphi Dec 26, 2024
d2033a0
fix(ResizablePanel): onSizeChange not fired in some cases
tenphi Dec 26, 2024
e8ced85
fix(Alert): change border radius to large
tenphi Dec 27, 2024
f10297b
fix(Radio): button styles
tenphi Dec 27, 2024
0442808
fix(Radio): button styles * 2
tenphi Dec 27, 2024
92bfaf5
fix(Radio): button styles * 3
tenphi Dec 27, 2024
75d519d
fix(Radio): button styles * 4
tenphi Dec 27, 2024
746c7dd
feat(Form): add clearFieldsValidation and setFieldError methods
tenphi Dec 27, 2024
6e22100
fix(Form): add deprecation warnings for createField and removeField
tenphi Dec 27, 2024
dc88774
feat(Form): add resetFieldsValidation and setFieldError methods * 2
tenphi Dec 27, 2024
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/afraid-plants-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': minor
---

Rename Submit to SubmitButton.
5 changes: 5 additions & 0 deletions .changeset/curly-boxes-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': patch
---

Recalculate the sidebar position on container resize.
5 changes: 5 additions & 0 deletions .changeset/dirty-rats-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': minor
---

Form's resetFields() method now resets errors and touched status as well.
5 changes: 5 additions & 0 deletions .changeset/funny-oranges-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': minor
---

Add `resetFieldsValidation()` and `setFieldError()` methods to form to replace deprecated `setFields()`.
5 changes: 5 additions & 0 deletions .changeset/khaki-houses-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': minor
---

Add ResetButton component.
5 changes: 5 additions & 0 deletions .changeset/lucky-beans-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': patch
---

Fix pressed state in primary type Button.
5 changes: 5 additions & 0 deletions .changeset/lucky-shoes-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': patch
---

Fix bug that prevents `onSizeChange()` callback from being fired when ResizablePanel resized beyond its constraints.
5 changes: 5 additions & 0 deletions .changeset/new-bees-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': minor
---

Simplify API of CopySnippet and improve its design.
5 changes: 5 additions & 0 deletions .changeset/swift-parents-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': minor
---

Allow to pass base styles to Alert as props.
5 changes: 5 additions & 0 deletions .changeset/thick-snails-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': minor
---

Add `isInvalid` and `isValid` props to form instance. First one checks if the form has at least one field that is verified and invalid. The second one checks if ALL fields are verified and valid. Be careful: `isValid` and `!isInvalid` are not the same.
5 changes: 5 additions & 0 deletions .changeset/wet-points-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': patch
---

Fix Radio.Button styles.
5 changes: 5 additions & 0 deletions .changeset/wet-weeks-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cube-dev/ui-kit': minor
---

More flexible and easier control over disable state of Reset and Submit buttons.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"react-transition-group": "^4.4.5",
"react-types": "^0.1.0",
"tiny-invariant": "^1.3.3",
"usehooks-ts": "^3.1.0",
"valid-url": "^1.0.9"
},
"devDependencies": {
Expand Down
14 changes: 14 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 38 additions & 15 deletions src/components/actions/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ export default {
defaultValue: undefined,
control: { type: 'radio', options: [undefined, 'small', 'large'] },
},
type: {
defaultValue: undefined,
control: {
type: 'radio',
options: [
undefined,
'secondary',
'primary',
'outline',
'clear',
'neutral',
'link',
],
},
},
// @TODO: Migrate to new API
// type: {
// defaultValue: undefined,
// control: {
// type: 'radio',
// options: [
// undefined,
// 'secondary',
// 'primary',
// 'outline',
// 'clear',
// 'neutral',
// 'link',
// ],
// },
// },
theme: {
defaultValue: undefined,
control: { type: 'radio', options: [undefined, 'danger', 'special'] },
Expand Down Expand Up @@ -133,6 +134,17 @@ const TemplateStates: StoryFn<CubeButtonProps> = ({
>
{label || 'Pressed'}
</Button>
<Button
{...props}
mods={{
hovered: true,
pressed: true,
focused: false,
disabled: false,
}}
>
{label || 'Pressed & Hovered'}
</Button>
<Button
{...props}
mods={{
Expand Down Expand Up @@ -197,6 +209,17 @@ const DarkTemplateStates: StoryFn<CubeButtonProps> = ({
>
{label || 'Pressed'}
</Button>
<Button
{...props}
mods={{
hovered: true,
pressed: true,
focused: false,
disabled: false,
}}
>
{label || 'Pressed & Hovered'}
</Button>
<Button
{...props}
mods={{
Expand Down
2 changes: 1 addition & 1 deletion src/components/actions/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ const ButtonElement = tasty({
'': '#clear',

'[data-type="primary"]': '#purple',
'[data-type="primary"] & pressed': '#purple',
'[data-type="primary"] & hovered': '#purple-text',
'[data-type="primary"] & pressed': '#purple',

'[data-type="secondary"]': '#purple.10',
'[data-type="secondary"] & hovered': '#purple.16',
Expand Down
31 changes: 0 additions & 31 deletions src/components/actions/Button/Submit.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/actions/Button/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './Button';
export * from './Submit';
2 changes: 1 addition & 1 deletion src/components/content/Alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const AlertElement = tasty({
styles: {
display: 'block',
flow: 'column',
radius: '1r',
radius: '@large-radius',
padding: '1.5x',
preset: 't3',
color: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/content/Alert/use-alert.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
CONTAINER_STYLES,
TEXT_STYLES,
extractStyles,
filterBaseProps,
TEXT_STYLES,
} from '../../../tasty';
import { useDeprecationWarning } from '../../../_internal';

Expand Down
54 changes: 54 additions & 0 deletions src/components/content/CopySnippet/CopySnippet.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,60 @@ JavascriptSyntax.args = {
sql: \`SELECT * FROM public.line_items\`,


joins: {
Products: {
sql: \`\${CUBE}.product_id = \${Products}.id\`,
relationship: \`belongsTo\`
},

Orders: {
sql: \`\${CUBE}.order_id = \${Orders}.id\`,
relationship: \`belongsTo\`
}
},

measures: {
count: {
type: \`count\`,
drillMembers: [id, createdAt]
},

price: {
sql: \`price\`,
type: \`sum\`
},

quantity: {
sql: \`quantity\`,
type: \`sum\`
}
},

dimensions: {
id: {
sql: \`id\`,
type: \`number\`,
primaryKey: true
},

createdAt: {
sql: \`created_at\`,
type: \`time\`
}
}
});`,
};

export const Complex = Template.bind({});
Complex.args = {
language: 'javascript',
height: 'max 30x',
hideText: 'SELECT * FROM public.line_items',
actions: <CopySnippet.Button icon={<SettingOutlined />} />,
code: `cube('LineItems', {
sql: \`SELECT * FROM public.line_items\`,


joins: {
Products: {
sql: \`\${CUBE}.product_id = \${Products}.id\`,
Expand Down
Loading
Loading