Skip to content

feat: responsive capacities based on breakpoints #5322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: beta
Choose a base branch
from
Open
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/tidy-states-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ultraviolet/themes": major
---

Removal of `theme.screen` into CSS variables and fixed breakpoints
5 changes: 5 additions & 0 deletions .changeset/yummy-jokes-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ultraviolet/ui": minor
---

Implement responsive capacities on component `<Row />` and `<Stack />`
1 change: 1 addition & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"react/iframe-missing-sandbox": "error",
"react/jsx-no-target-blank": "off",
"react/react-in-jsx-scope": "off",
"react/no-array-index-key": "off",
"react/jsx-filename-extension": [
"error",
{ "extensions": [".jsx", ".tsx"] }
Expand Down
29 changes: 28 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,31 @@ import { dark, light } from './storybookThemes'
import '@ultraviolet/fonts/fonts.css'
import { scan } from "react-scan"

const BREAKPOINT_ORDER = [
'xlarge',
'large',
'medium',
'small',
'xsmall',
'xxsmall',
]

const VIEWPORTS = BREAKPOINT_ORDER.reduce((acc, key) => {
if (key in lightTheme.breakpoints) {
return {
...acc,
[key]: {
name: key,
styles: {
width: lightTheme.breakpoints[key as keyof typeof lightTheme.breakpoints],
height: '600px',
},
},
}
}
return acc
}, {})

scan({
enabled: true,
log: true,
Expand Down Expand Up @@ -52,7 +77,9 @@ const parameters: Preview['parameters'] = {
canvas: { hidden: false },
},
viewport: {
viewports: {},
viewports: {
...VIEWPORTS
}
},
options: {
storySort: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1646,10 +1646,6 @@ exports[`CheckboxField > should render correctly with errors 1`] = `
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.25rem;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: normal;
-webkit-box-align: normal;
-ms-flex-align: normal;
Expand All @@ -1665,17 +1661,17 @@ exports[`CheckboxField > should render correctly with errors 1`] = `
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: 0.25rem;
}

.emotion-12 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.25rem;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
Expand All @@ -1691,6 +1687,10 @@ exports[`CheckboxField > should render correctly with errors 1`] = `
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
gap: 0.25rem;
}

.emotion-15 {
Expand Down Expand Up @@ -2030,10 +2030,6 @@ exports[`CheckboxField > should trigger events correctly 1`] = `
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.25rem;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: normal;
-webkit-box-align: normal;
-ms-flex-align: normal;
Expand All @@ -2049,17 +2045,17 @@ exports[`CheckboxField > should trigger events correctly 1`] = `
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: 0.25rem;
}

.emotion-12 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.25rem;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
Expand All @@ -2075,6 +2071,10 @@ exports[`CheckboxField > should trigger events correctly 1`] = `
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
gap: 0.25rem;
}

.emotion-15 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ exports[`CheckboxField > should render correctly checked 1`] = `
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.5rem;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: normal;
-webkit-box-align: normal;
-ms-flex-align: normal;
Expand All @@ -27,6 +23,10 @@ exports[`CheckboxField > should render correctly checked 1`] = `
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: 0.5rem;
}

.emotion-4 {
Expand All @@ -40,10 +40,6 @@ exports[`CheckboxField > should render correctly checked 1`] = `
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.75rem;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: normal;
-webkit-box-align: normal;
-ms-flex-align: normal;
Expand All @@ -56,17 +52,17 @@ exports[`CheckboxField > should render correctly checked 1`] = `
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: 0.75rem;
}

.emotion-8 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.25rem;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: normal;
-webkit-box-align: normal;
-ms-flex-align: normal;
Expand All @@ -79,6 +75,10 @@ exports[`CheckboxField > should render correctly checked 1`] = `
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: 0.25rem;
}

.emotion-11 {
Expand Down Expand Up @@ -327,10 +327,6 @@ exports[`CheckboxField > should render correctly checked 1`] = `
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.25rem;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: normal;
-webkit-box-align: normal;
-ms-flex-align: normal;
Expand All @@ -346,17 +342,17 @@ exports[`CheckboxField > should render correctly checked 1`] = `
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: 0.25rem;
}

.emotion-26 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.25rem;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
Expand All @@ -372,6 +368,10 @@ exports[`CheckboxField > should render correctly checked 1`] = `
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
gap: 0.25rem;
}

.emotion-29 {
Expand Down Expand Up @@ -550,10 +550,6 @@ exports[`CheckboxField > should trigger events correctly with required prop 1`]
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.5rem;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: normal;
-webkit-box-align: normal;
-ms-flex-align: normal;
Expand All @@ -566,6 +562,10 @@ exports[`CheckboxField > should trigger events correctly with required prop 1`]
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: 0.5rem;
}

.emotion-4 {
Expand All @@ -579,10 +579,6 @@ exports[`CheckboxField > should trigger events correctly with required prop 1`]
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.75rem;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: normal;
-webkit-box-align: normal;
-ms-flex-align: normal;
Expand All @@ -595,17 +591,17 @@ exports[`CheckboxField > should trigger events correctly with required prop 1`]
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: 0.75rem;
}

.emotion-8 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.25rem;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: normal;
-webkit-box-align: normal;
-ms-flex-align: normal;
Expand All @@ -618,17 +614,17 @@ exports[`CheckboxField > should trigger events correctly with required prop 1`]
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: 0.25rem;
}

.emotion-10 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.25rem;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-align-items: start;
-webkit-box-align: start;
-ms-flex-align: start;
Expand All @@ -641,6 +637,10 @@ exports[`CheckboxField > should trigger events correctly with required prop 1`]
-webkit-flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
gap: 0.25rem;
}

.emotion-13 {
Expand Down Expand Up @@ -901,10 +901,6 @@ exports[`CheckboxField > should trigger events correctly with required prop 1`]
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.25rem;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-align-items: normal;
-webkit-box-align: normal;
-ms-flex-align: normal;
Expand All @@ -920,17 +916,17 @@ exports[`CheckboxField > should trigger events correctly with required prop 1`]
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: 0.25rem;
}

.emotion-30 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
gap: 0.25rem;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
Expand All @@ -946,6 +942,10 @@ exports[`CheckboxField > should trigger events correctly with required prop 1`]
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
gap: 0.25rem;
}

.emotion-33 {
Expand Down
Loading
Loading