feat(design-system)!: add DsButton v1.3 [AR-52648]#308
feat(design-system)!: add DsButton v1.3 [AR-52648]#308mmurawski-dn wants to merge 11 commits intodrivenets:nextfrom
Conversation
9f7790d to
5238a39
Compare
packages/design-system/src/components/ds-button/versions/ds-button-v3/ds-button-v3.types.ts
Show resolved
Hide resolved
| /** | ||
| * If true the 'pressed' styles are applied | ||
| */ | ||
| selected?: boolean; |
There was a problem hiding this comment.
If it better to call this prop selected or pressed?
There was a problem hiding this comment.
I was not sure 🤔 I chose selected, because in the future we might have button group component (and selected prop would fit much better). Maybe I could change comment?
There was a problem hiding this comment.
Ok, let's keep the name, but change the comment.
packages/design-system/src/components/ds-button/versions/ds-button-v3/ds-button-v3.tsx
Show resolved
Hide resolved
ebb606f to
8afa833
Compare
…venets#314) <img width="468" height="76" alt="image" src="https://github.com/user-attachments/assets/3761251e-b757-49fa-a456-90f357104fe2" /> <img width="480" height="81" alt="image" src="https://github.com/user-attachments/assets/02f6239e-ed04-4092-af8f-e08c99343bd0" /> --------------------------- <img width="489" height="85" alt="image" src="https://github.com/user-attachments/assets/cfc29e9f-9c5b-41a2-86e1-a252bf006f55" /> <img width="485" height="82" alt="image" src="https://github.com/user-attachments/assets/95e0a86c-2ceb-4b76-a149-0da3a1d813b3" /> Co-authored-by: Evyatar Daud <32631382+StyleShit@users.noreply.github.com>
…e` [AR-53523] (drivenets#289) <img width="378" height="140" alt="image" src="https://github.com/user-attachments/assets/3ed90c2d-47e8-433b-bc57-c0ba0c16a195" /> <img width="388" height="141" alt="image" src="https://github.com/user-attachments/assets/50c0d779-5040-4cad-9da7-7a23225f69e7" />
…enets#302) [Jira](https://github.com/drivenets/design-system/pull/AR-48187-dap-design-system-date-and-time-picker) | [Figma](https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=30063-134151&m=dev) ## Context This PR 3rd of 4 main PRs to create a Date Time Range picker components: 1. ✅ `Time Picker` component - standalone Time Picker component. [PR](drivenets#255) 2. ✅ `Date Picker component` - standalone Date Picker component with option to select time. It will use `Time Picker` component inside. [PR](drivenets#283) 3. 🫵 **`Date Range Picker` component - combines 2 `Date Picker` component** 4. ✅ Deprecate `DateInput` component ## Showcase https://github.com/user-attachments/assets/64849310-2a79-42f6-9e02-be00400377db
8afa833 to
2a99d3d
Compare
drivenets#275) Co-authored-by: Evyatar Daud <32631382+StyleShit@users.noreply.github.com>
…enets#288) [Jira](https://github.com/drivenets/design-system/pull/AR-48187-dap-design-system-date-and-time-picker) | [Figma](https://www.figma.com/design/nha3m67y7S57cHCSuQO2gp/DAP-Design-System-1.2?node-id=30063-134151&m=dev) ## Context This PR is last of 4 main PRs to create a Date Time Range picker components: 1. ✅ `Time Picker` component - standalone Time Picker component. [PR](drivenets#255) 2. ✅ `Date Picker component` - standalone Date Picker component with option to select time. It will use `Time Picker` component inside. [PR](drivenets#283) 3. ✅ `Date Range Picker` component - combines 2 `Date Picker` component 4. 👇 **Deprecate `DateInput` component** ❗❗❗ It has to be merged last ❗❗❗ ## Showcase <img width="1897" height="839" alt="image" src="https://github.com/user-attachments/assets/10c33c00-4d04-460e-8daa-efbdb9e95a69" />
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @drivenets/design-system@0.8.0 ### Minor Changes - 73e3010: Add `DsDatePicker` component - 1fa6a48: Deprecated `DsDateInput` component - 27151fc: Add `DsKeyValuePair` component - 5cd65b4: Add `DsTimePicker` component - ad3aad4: Add `DsDateRangePicker` component ### Patch Changes - 0335e72: Capitalize only the first word in `DsStatusBadge` - 6dc2bbe: Fix font size in `DsDropdownMenu` item - 8aaa33b: Update dependencies - 56d993b: Fix table issues related to React Compiler - 8c56a53: Add `hideActionRequired` prop to `DsCommentBubble` - 7752e64: Add aria role to `DsLoader` - 5a59014: Remove ellipsis from `DsTooltip` Add `slotProps` to `DsTooltip` - e6da4c4: Fix `DsAutocomplete` onValueChange trigger, fix clear button - 16f7361: Fix styles in `DsCommentBubble` - eef2a74: Use semantic HTML structure in `DsTable` empty view - ba7fb97: Fix File prototype loss in `DsFileUpload` ## @drivenets/eslint-plugin-design-system@0.0.12 ### Patch Changes - 1fa6a48: Add deprecation rule for `DsDateInput` Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
| // Dynamic by nature of this component | ||
| // eslint-disable-next-line react/button-has-type | ||
| type={type} | ||
| disabled={disabled} |
There was a problem hiding this comment.
disabled={disabled || loading}
pointer-events: none are not disabling the element in case of enter\space selection
There was a problem hiding this comment.
The issue is, the designs show loading state in "normal" colors. Any idea how to go around it?
| data-color={color} | ||
| data-on-dark={onDark ? 'true' : undefined} | ||
| data-variant={variant} | ||
| data-selected={selected ? 'true' : undefined} |
There was a problem hiding this comment.
data-selected is invisible to screen readers - toggle buttons should use aria-pressed
packages/design-system/src/components/ds-button/versions/ds-button-v3/ds-button-v3.tsx
Outdated
Show resolved
Hide resolved
<img width="1090" height="927" alt="image" src="https://github.com/user-attachments/assets/c26b0caa-e86b-4cd8-aebe-1e65c45a699c" />
packages/design-system/src/components/ds-button/versions/ds-button-v3/ds-button-v3.tsx
Show resolved
Hide resolved
| } | ||
| } | ||
|
|
||
| .root[data-color='default'][data-variant='primary'] { |
There was a problem hiding this comment.
Mixin usage here looks reasonable to reduce boilerplate parts
@mixin button-variant($bg, $hover-bg, $active-bg, $text, $border) {
background-color: $bg;
color: $text;
border-color: $border;
&:hover:not(:disabled):not(:active):not([data-selected='true']) {
background-color: $hover-bg;
}
}
There was a problem hiding this comment.
To be fair, I would prefer going explicit. Easier to debug and adjust 🤔
| ref?: Ref<HTMLButtonElement>; | ||
| className?: string; | ||
| style?: CSSProperties; | ||
| children?: ReactNode; |
There was a problem hiding this comment.
className, style, children are already in ButtonHTMLAttributes
| import { DsButtonV3 } from '..'; | ||
| import styles from '../ds-button-v3.module.scss'; | ||
|
|
||
| describe('DsButtonV3', () => { |
There was a problem hiding this comment.
No tests for:
disabled + loading combined
selected + disabled combined
onDark + color="negative" interaction
310d33e to
64c5abd
Compare
https://drivenets.atlassian.net/browse/AR-52647
bttn.webm