Commit graph

291 commits

Author SHA1 Message Date
Enrico Sacchetti
a581231d16 chore: adjust types
- Fix ButtonSkeleton sizes
- Apply v11 `size` props
2024-01-19 16:30:40 -05:00
Enrico Sacchetti
c51c40c9f4 chore: adjust size type 2024-01-19 16:00:01 -05:00
Enrico Sacchetti
018d780bc3 fix: only apply v11 change to button 2024-01-19 15:50:47 -05:00
Enrico Sacchetti
997cc1fa5e feat: upgrade Button to v11 styles
Button changes

##BREAKING CHANGES

- `skeleton` prop has been removed. Use `ButtonSkeleton` component instead
- `size` prop has new values
- `kind` prop has new values
- `isSelected` is now `selected
- `on:mouseover`, `on:mouseenter`, and `on:mouseleave` forwarded events were replaced with `on:pointerover`, `on:pointerenter`, and `on:pointerleave`
- `as` no longer accepts boolean types

## Features

- New `2xl` size
- `expressive` styles now apply to all button sizes
- `as` accepts a string to specify a desired HTML element
2024-01-16 16:30:06 -05:00
Enrico Sacchetti
c0d037dfca feat!: initial pre-release - Carbon v11 styles (#1881)
**carbon-components-svelte has unstable styles and interactions during this pre-release phase. See #1872 for details.**

Breaking changes

- Overall, this is a major style change the will impact the appearance and features of many components. Use caution when upgrading and test your applications.

Components

- Button has new prop values for size and kind
- Theme follows v11 conventions: g80 theme isn't supported, toggled themes adjust data-carbon-theme attribute in <html> tag (for now, tokens use bx prefix, but that may change)
- Tabs has a contained prop instead of type, and a new mobile appearance (scrolling tabs)
- ContentSwitcher size prop no longer supports size="xl"; md is the new default
- MultiSelect no longer supports xl size
- OverflowMenu no longer supports xl size
- Search no longer supports xl size
- TreeView no longer supports compact size
- UIShell has a new light theme

CSS

- Several class names have been changed due to the v11 overhaul. If you're targeting or overriding component classes, be sure to test your code
- Many tokens and CSS variables have been renamed. Details: https://carbondesignsystem.com/migrating/guide/develop
- Themes are applied to the <html> element as data-carbon-theme="g10" instead of theme="g10"
- The g80 theme no longer exists

General

- Codebase uses npm instead of yarn

--- Commit notes

* chore: depend on @carbon/styles instead of carbon-components

See upgrade guide here: https://carbondesignsystem.com/migrating/guide/develop

* chore: use v11 styles for docs

* chore: stick to `bx` instead of `cds` class prefix

* chore: migrate layout spacing to v11

See [@carbon/layout](https://github.com/carbon-design-system/carbon/blob/main/docs/migration/v11.md#carbonlayout) migration guide:

    $layout-01 	Removed, use $spacing-05 instead
    $layout-02 	Removed, use $spacing-06 instead
    $layout-03 	Removed, use $spacing-07 instead
    $layout-04 	Removed, use $spacing-09 instead
    $layout-05 	Removed, use $spacing-10 instead
    $layout-06 	Removed, use $spacing-12 instead
    $layout-07 	Removed, use $spacing-13 instead

* chore: migrate type tokens to v11

See https://github.com/carbon-design-system/carbon/blob/main/docs/migration/v11.md#type-tokens

* chore: keep flex-grid instead of css grid for the moment

Upgrading to css-grid should be separate.

* chore: v11 Tabs

In v11 [Tabs](https://carbondesignsystem.com/migrating/guide/design/#tabs-breaking) received some additional modifiers. In this commit we only want to make sure that the Svelte v10 tabs still work using v11 styles. This probably needs additional testing.

* chore: use @ibm/plex fonts

* chore: v11 Button

* dependency: @carbon/styles update

* chore: v11 ComboBox

Size `xl` changed to `lg`. For better compatibility with existing codebases size `xl` is still supported.

* chore: v11 ContentSwitcher

For better compatibility with existing code bases size `xl` is still supported.

* chore: remove legacy v10 css files

Note that further work is needed here in order to make theming work again.
Also documentation needs updating.

* chore: v11 DatePicker

For better compatibility with existing codebases size xl is still supported.

* chore: v11 Dropdown

For better compatibility with existing codebases size xl is still supported.

* chore: v11 ExpandableTile

Note that state labels `tileCollapsedLabel` and `tileExpandedLabel` are no longer supported.

* chore: v11 FileUploader

For better compatibility with existing codebases sizes `field` and `small` are still supported. Note that flagship implementation does the same thing.

* chore: v11 Toggle

This removes legacy `ToggleSkeleton`.

* chore: v11 MultiSelect

Size `xl` changed to `lg`.

* chore: v11 NumberInput

For better compatibility with existing codebases size `xl` is still supported.

* chore: v11 OverflowMenu

Size `xl` changed to `lg`. For better compatibility with existing codebases size `xl` is still supported.

* chore: v11 PasswordInput

Size `xl` changed to `lg`. For better compatibility with existing codebases size `xl` is still supported.

* chore: v11 Search

* chore: v11 Select

Size `xl` changed to `lg`. For better compatibility with existing codebases size `xl` is still supported.

* chore: v11 AspectRatio

The `bx--aspect-ratio--object` class is gone and needs to be replaced manually.

* chore: v11 TextArea

`cols` no longer has a defaults to 50 but remains at 100% width by default.

* chore: v11 TextInput

Size `xl` changed to `lg`. For better compatibility with existing codebases size `xl` is still supported.

* chore: v11 TimePicker

Size `xl` changed to `lg`. For better compatibility with existing codebases size `xl` is still supported.

* chore: v11 TreeView

Size `compact` changed to `xs`. For better compatibility with existing codebases size `compact` is still supported.

* chore: remove Truncate since it does not exist in Carbon v11

* chore: v11 UIShell

* chore: v11 Accordion

Size `xl` changed to `lg`. For better compatibility with existing codebases size `xl` is still supported.

* tmp: v11 PopoverContent

* Revert "chore: remove Truncate since it does not exist in Carbon v11"

This reverts commit 5833536199.

* chore: use truncate mixins

* docs: add truncate mixins

* chore: use `cds` class prefix in v11 styles

* build: switch to npm

* chore: set up all component styles, fonts, and themes

- Adapt documentation to new styles

* chore: add individual theme css

* feat: migrate Theme component to v11

- remove g80 theme option everywhere
- utilize new `data-carbon-theme` attribute when applying theme
- use cds instead of bx in places

* chore: use bx css prefixes for now

* chore: resolve peerDependencies

- Leaving out latest prettier for now
- Ignoring Sveld warnings for now

* chore: fix type errors and tests

---------

Co-authored-by: Gregor Wassmann <gregor.wassmann@gmail.com>
2024-01-12 13:45:09 -05:00
Eric Liu
d3e5b3dd54 chore: re-install sveld and run yarn build:docs 2024-01-09 20:15:04 -08:00
Ryan Marx
59018728df
fix(button): forward on:focus event (#1878)
Fixes #1830
2024-01-09 20:09:11 -08:00
metonym
479225711a
fix(radio-button): allow value type to be a number (#1868) 2023-12-17 09:42:28 -08:00
Eric Liu
292881dc3e chore: remove types/README.md [ci skip]
Avoid publishing this file as part of the package since this is not relevant to consumers of the library.
2023-12-07 19:08:00 -08:00
metonym
1ad4e3d385
feat(tree-view): add showNode accessor (#1844)
Closes #1377
2023-11-12 14:25:15 -08:00
metonym
6a55fef62e
feat(tree-view): make node slottable (#1843)
Closes #1660
2023-11-12 14:15:28 -08:00
Eric Liu
a9460e944d
fix(select-item): export class and style props (#1840)
Closes #1839
2023-11-07 18:58:45 -08:00
Enrico Sacchetti
7ba52df3a1
fix(multi-select): render checkboxes for form data (#1835)
* chore: downgrade docs to svelte 3 for compatibility
* chore(multi-select): keep checkboxes rendered in DOM
* Display ListBox via CSS

See #1742
2023-10-26 21:21:37 -04:00
Eric Liu
06d81ddbff
fix(radio-button-group): strongly type dispatched change/select events (#1819) 2023-10-03 11:23:17 -07:00
Eric Liu
836b360b9b
fix(tile-group): add name and required props (#1818) 2023-10-03 11:20:16 -07:00
Alex Rock
9456eaab3c
feat(data-table): pass row to display function (#1810) 2023-10-01 10:19:13 -07:00
brunnerh
24e2a8874f
fix(radio-button-group): add name and required props (#1037)
Fixes #1036
2023-10-01 10:14:53 -07:00
Michael Greminger
e5675eb203
feat(ui-shell): forward click event to HeaderActionLink (#1797)
Closes #1796
2023-08-26 10:17:05 -07:00
Eric Liu
51c281de4a
feat(file-uploader): add size prop to FileUploaderButton (#1786) 2023-07-24 06:33:53 -07:00
Eric Liu
d6804b44fe
fix(loading)!: remove redundant description label (#1783)
Fixes #1670
2023-07-23 14:07:55 -07:00
Eric Liu
a7443c2dca
fix(types): correctly type kind prop in FileUploader, FileUploaderButton (#1781) 2023-07-23 12:42:33 -07:00
Eric Liu
be763706ca
fix(types): improve formatting of prop comments (#1779) 2023-07-23 12:25:44 -07:00
Eric Liu
239f1b10e5
feat(file-uploader): make labelTitle, labelDescription slottable (#1780) 2023-07-23 12:25:31 -07:00
Eric Liu
baff07e012
feat(slider): add hideLabel prop (#1777)
Closes #1682

Co-authored-by: siaikin <abc1310054026@outlook.com>
2023-07-23 12:04:39 -07:00
Eric Liu
2f026f792a
feat(typescript)!: support svelte 4 (#1773)
Closes #1753 

The minimum Svelte version required for TypeScript users is now 3.55.
2023-07-19 09:44:56 -07:00
Eric Liu
7885e124b4 chore(types): fix formatting of prop comments in Header, SideNav 2023-07-13 10:52:52 -07:00
Eric Liu
2715ed9c38 chore(ui-shell): update company prop description in Header (#1770) 2023-07-13 10:50:51 -07:00
Nestor Orest Plysyuk
ea9b261b60
feat(ui-shell): add preventCloseOnClickOutside to HeaderAction (#1625)
Closes #1624
2023-07-13 07:37:21 -07:00
Janos Lengyel
9b3f014a0b
feat(ui-shell): make company in Header slottable (#1764) 2023-07-13 07:33:48 -07:00
Eric Liu
7fdc2ef7f0
fix(types): allow data-* attributes for props forwarded to HTML elements (#1741)
* chore(deps-dev): upgrade `sveld` to v0.18.1

* Run "yarn build:docs"

* test: assert that `data-*` attributes are valid
2023-07-08 16:41:44 -07:00
Sachin
0b4f19c87e
feat: make titleText slottable in MultiSelect, ComboBox (#1750)
Closes #1747
2023-06-11 18:45:55 -07:00
Sam
60a796ea48
feat(pagination-nav): add tooltipPosition prop (#1733)
* Add `tooltipPosition` to `PaginationNav` per #1656

* Rebuild test

* Update description in documentation

Co-authored-by: Enrico Sacchetti <esacchetti@gmail.com>

* chore: update docs

---------

Co-authored-by: Samuel Janda <hi@simpleprogramming.com.au>
Co-authored-by: Enrico Sacchetti <esacchetti@gmail.com>
Co-authored-by: Enrico Sacchetti <enrico@theetrain.ca>
2023-05-21 13:59:53 -04:00
Pierre
b9aaa3adca
feat(ui-shell): make HeaderNavItem slottable (#1693) 2023-05-02 16:23:04 -07:00
metonym
ca40dd18c2
fix(selectable-tile): include dispatched events in types (#1695)
Fixes #1694
2023-03-20 21:27:29 -04:00
Jonathan Quintin
7ddbf17cbb
feat(progress-bar): add status prop (#1560)
* ProgressBar status feature added

* ProgressBar: Removed the css variables and use carbon-css instead.
The way of assigning the ProgressBar value has change. It is now a style
variable and scale-x is calculated in the css. This way prevent the
override of carbon css.

* Removed an unessacery span.

* Removed an unnecessary span.

* Added the status for the ProgressBarUx

* Remove `style css` and update docs.

* - Fixed the `capped` variable for more readability
- Updated docs `label` and `helperText`
- Updated docs and css

* fix: finished/error states cannot be indeterminate

* Run "yarn build:css"

* Re-run "yarn build:docs"

* test(progress-bar): assert `status` prop

* chore: add aria-busy and set valuenow to 0 when not active

---------

Co-authored-by: Eric Liu <ericyl.us@gmail.com>
Co-authored-by: Enrico Sacchetti <enrico@theetrain.ca>
2023-02-19 12:34:41 -05:00
metonym
6450e8b0b1
fix(types): add missing $$restProps for Checkbox, Filename, FluidForm (#1655)
* fix(types): add missing `$$restProps` for `Checkbox`, `Filename`, `FluidForm`

* Run "yarn build:docs"

* test: assert `$$restProps` for `Checkbox`, `Form`
2023-02-11 13:50:01 -05:00
metonym
ec867c46ba
fix(tree-view)!: remove expanded property from TreeNode interface (#1631)
* fix(tree-view)!: remove `expanded` property from `TreeNode`

* fix(tree-view-node-list)!: remove unused `expanded` prop

* docs(tree-view): remove `expanded` as a property

#1630
2023-01-17 20:55:46 -05:00
Enrico Sacchetti
6d2e21f027
chore: improve lint, release workflows (#1627)
* Add standard-version to automate releases

* Remove husky

* Add lint script; run lint in GitHub Actions

* Run lint script

* Add Enrico to contributors
2023-01-15 15:34:09 -08:00
Enrico Sacchetti
50066966da
feat(notification)!: replace iconDescription prop with statusIconDescription, closeButtonDescription (#1591)
Fixes #672, fixes #1563

* breaking: remove `iconDescription` prop from `InlineNotification`, `ToastNotification`

* breaking: require `iconDescription` prop in `NotificationIcon`

* feat: add new `statusIconDescription` and `closeButtonDescription` to `InlineNotification`, `ToastNotification`
2022-12-18 15:28:23 -08:00
Gregor Wassmann
e258db0cae
docs(pagination-nav): add change event docs (#1592)
It seems that in #1518 some docs were not properly generated.

This is the change that results from running `yarn build:docs`.
2022-12-17 09:06:40 -05:00
Enrico Sacchetti
8d55752a18
fix(pagination-nav)!: use 1-indexing to be consistent with Pagination (#1518)
Fixes #1513
2022-12-13 10:23:04 -08:00
Enrico Sacchetti
9198ed5474
feat!: dispatch "change" event in Pagination, rename "change" to "update" in Select (#1497)
Closes #1491

* feat(pagination): dispatch "change" event when interacting with previous/next buttons, page/page size dropdowns

* breaking(select): rename dispatched "change" event to "update"

* breaking(select): forward `change` event to `Select`
2022-12-13 10:22:17 -08:00
metonym
724d90bd7b
chore(types)!: remove sveltekit: attributes from types (#1581)
* chore(deps-dev): upgrade sveld 0.17.2 -> 0.18.0

* Run "yarn build:docs"
2022-12-11 15:58:19 -05:00
metonym
837716ff8b fix(overflow-menu): dispatch "close" event when clicking outside (#1546)
Fixes #1541
2022-12-07 20:25:47 -08:00
Maxime Fafard
0f8a57b9d2
fix(popover): fire "click:outside" event when clicking sibling elements (#1570) 2022-12-07 20:10:45 -08:00
metonym
198e0da4c5
fix(tree-view): loosen TreeNode text property type to any (#1576)
* fix(tree-view): loosen `TreeNode` text property type to any

* Run "yarn build:docs"

* test(tree-view): assert updated property type value
2022-12-07 20:00:20 -08:00
DetachHead
21d841feeb
fix(tree-view): make TreeView children prop type work recursively (#1566) 2022-12-07 19:54:14 -08:00
metonym
1c4ee00142
fix(search): prop types should extend input attributes (#1523)
Fixes #1520
2022-10-13 22:04:32 -07:00
Ben Periton
bd8741e45b
fix(toolbar-search): forward keyup, keydown, paste events to Search (#1490) 2022-09-21 08:25:27 -07:00
metonym
dbe33d5cbb
feat(toolbar-search): add filteredRowIds prop to support pagination (#1454)
Closes #1393

* feat(toolbar-search): add `filteredRowIds` prop

* Run "yarn build:docs"

* test(data-table): assert `filteredRowIds` prop

* docs(data-table): add pagination to default filterable examples
2022-08-18 06:59:14 -07:00