Commit graph

110 commits

Author SHA1 Message Date
Sam
5031d0b40e feat(layer): first pass at Layer component (#1932)
Closes #1892
2024-03-23 16:48:13 -07:00
Sam
9efe5255d2 feat!: TextInput v11 Styles (#1889)
* Initial commit

* Fixes [FluidForm] TextInput error icon is misplaced #1667

* Contributes to [TextInput] helperText enhancements #1633

* Adopts Standardize props and events #1621

* Added slots for Standardize props and events #1621

* Added pointer events, updated skeleton TextInput v11 #1888

* Address a bug in the word counter regex

* Update src/TextInput/TextInput.svelte

Correcting type attribute definition for HTML attributes

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

* Update src/TextInput/TextInput.svelte

Correcting type attribute definition for HTML attributes

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

* Update src/TextInput/TextInput.svelte

Explicitly define default value for `size`

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

* Adopted suggested changes

* Updated `TextInput.test`; added forgotten files from previous

---------

Co-authored-by: Samuel Janda <hi@simpleprogramming.com.au>
Co-authored-by: Enrico Sacchetti <esacchetti@gmail.com>
2024-03-23 16:47:54 -07:00
Enrico Sacchetti
4dabb827ee 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-03-23 16:46:40 -07:00
spburtsev
d8bc65163e
feat(ui-shell): support button tooltip in HeaderGlobalAction (#1894)
Closes #1893
2024-03-07 20:37:58 -08:00
mmamedel
90dbd1562b
fix(slider): dispatch on:input event (#1906)
Fixes #1643

The dispatched `on:change` event in `Slider` only fires when the slider thumb is released. `on:input` fires when actively dragging the thumb, and should fire on every increment (e.g., 1, 2, 3).
2024-02-10 20:44:39 -08:00
metonym
6590457574
fix(types): improve e.detail type for dispatched events (#1907)
* fix(types): improve `e.detail` type for dispatched events

* Run "yarn build:docs"

* test: assert new types
2024-02-01 10:56:34 -05: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
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
Eric Liu
51c281de4a
feat(file-uploader): add size prop to FileUploaderButton (#1786) 2023-07-24 06:33:53 -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
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
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
Eric Liu
7381a03951
chore(deps-dev): upgrade svelte-check to version 3 (#1739)
* chore(deps-dev): upgrade svelte-check, @tsconfig/svelte

* chore(types): fix type error in `TreeView`

* chore: adjust `test:types` command to ignore folders
2023-07-04 14:00:24 -07: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
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
Jonathan Quintin
e6f5766e46
fix(number-input): support floating point values (#1555)
Fixes #233, fixes #486, fixes #1554
2022-12-07 20:06:29 -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
metonym
1c4ee00142
fix(search): prop types should extend input attributes (#1523)
Fixes #1520
2022-10-13 22:04:32 -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
metonym
8fea168ffd
feat(toast-notification): add fullWidth prop (#1444)
* feat(toast-notification): add `fullWidth` prop

* Run "yarn build:docs"

* test(toast-notification): assert `fullWidth` prop

* docs(toast-notification): add "Full width" example
2022-08-14 14:56:02 -07:00
metonym
7fe9b39436
fix(number-input): forward keydown, keyup events (#1424)
Fixes #1421

`NumberInput` should forward the keydown and keyup events like other input components.
2022-08-05 04:50:40 -07:00
metonym
f4d12b805a
fix(toggle): add missing hideLabel prop (#1414)
* fix(toggle): add missing hideLabel prop

* Run "yarn build:docs"

* test(toggle): assert hideLabel prop

* docs(toggle): add "Hidden label text" example
2022-07-26 07:12:57 -07:00
metonym
1ccdf64504
feat(slider): add fullWidth prop (#1354)
The `bx--slider` class in the `Slider` component has max-width of `40rem`. Because `$$restProps` is spread to the top-level `div` element in `Slider`, the only way to override the style is to do so globally:

```css
:global(.bx--slider-container) {
  width: 100%;
}

:global(.bx--slider) {
  max-width: none;
}
```

This adds a `fullWidth` prop that sets a full width style using inline style attributes.
2022-06-18 12:47:10 -07:00
metonym
78d3f1328a
feat(select): support selected prop number type (#1355)
* feat(select): support number type

* Run "yarn build:docs"

* refactor(pagination): do not coerce `pageSize`, `page` to be numbers

* test(select): assert selected prop number type
2022-06-18 11:09:41 -07:00
metonym
72c24b83b2
feat(data-table): support programmatic sorting (#1337)
* refactor(data-table): pass down sortable props instead of using context

* feat(data-table): support programmatic sorting

* test(data-table): assert new props

* docs(data-table): add "Programmatic sorting" example

* refactor(data-table): remove unused tableSortable store

* refactor(data-table): remove unused indices
2022-06-05 13:37:50 -07:00
metonym
260bf4e040
breaking(types): type arrays as read-only (#1335)
Closes #1259

* breaking(types): type arrays as read-only

* Run "yarn build:docs"

* test: assert read-only arrays
2022-06-05 13:25:43 -07:00
metonym
e230db8115
feat: forward paste event to input/textarea elements (#1332)
* chore(deps-dev): upgrade sveld, svelte-check

* feat: forward paste event to input/textarea elements

* Run "yarn build:docs"

* test: assert paste event
2022-06-02 18:39:49 -07:00
metonym
f25a10c9c4
feat: support item.disabled key for Dropdown, MultiSelect, ComboBox (#1328)
Closes #1326

* feat: support item.disabled key for `Dropdown`, `MultiSelect`, `ComboBox`

* Run "yarn build:docs"

* test: assert disabled property

* docs: add "Disabled items" examples
2022-06-02 17:56:30 -07:00
metonym
c6f210899b
feat(data-table): allow custom column widths (#1265)
* feat(data-table): allow header column `width`, `minWidth` values

* Run "yarn build:docs"

* test(data-table): assert width, minWidth properties

* docs(data-table): add "Custom column widths" example
2022-05-14 09:24:24 -07:00
metonym
5576c7ce84
fix(header-action): type missing "open" event (#1293)
* fix(header-action): type missing "open" event

* Run "yarn build:docs"

* test(header-utilities): assert "open" and "close" events
2022-05-12 20:23:16 -07:00
metonym
1454eeae19
feat(code-snippet): dispatch "expand" and "collapse" events (#1291)
* test(code-snippet): simply assertions

* feat(code-snippet): dispatch "expand," "collapse" events

* Run "yarn build:docs"

* test(code-snippet): assert events
2022-05-12 19:52:31 -07:00
metonym
d242849780
fix(dropdown): strongly type translateWithId (#1286) 2022-05-04 07:52:42 -07:00
metonym
f7146b61dc
fix: remove translateWithIdMenu, use translateWithId instead, rename translateWithIdInput (#1285)
* fix: remove translateWithIdMenu, use translateWithId instead

* chore: rename translateWithIdInput to translateWithIdSelection
2022-05-04 07:40:10 -07:00
metonym
0c39506dcb
fix(types): strongly type translateWithId parameters (#1284) 2022-05-04 07:31:51 -07:00
metonym
ff2e6276db
fix: ComboBox, MultiSelect should have multiple translateWithId functions (#1283)
* fix(combo-box): ListBoxField and ListBoxSelection have different `translateWithId` props

* fix(multi-select): ListBoxField and ListBoxSelection have different `translateWithId` props

* Run "yarn build docs"

* test: assert translateWithIdMenu, translateWIthIdInput props
2022-05-04 07:17:35 -07:00
metonym
45c272642f
fix(link): $$restProps should extend p, a HTML attributes (#1233)
* fix(link): restProps should extend `p` or `a` tag attributes

* Run "yarn build:docs"

* test(link): assert anchor link rest attributes
2022-04-09 11:24:25 -07:00
metonym
ba58ba8f00
refactor: use icons from carbon-icons-svelte@11 (#1227)
* chore: update ignore rules, remove unused files

* refactor(icons): use icons from carbon-icons-svelte@11

* docs(time-picker): fix default value

* chore: upgrade carbon-icons-svelte to v11

* docs: update examples to use icons from carbon-icons-svelte@11

* docs: update number of icons [ci skip]
2022-04-03 11:57:28 -07:00
metonym
9143e50244
breaking(actions): move truncate action to src/Truncate (#1224)
* breaking: move truncate action to src/Truncate

* docs: update truncate docs
2022-04-02 12:04:33 -07:00
metonym
d34f571150
docs: use all.css for prefixed styles (#1221)
* docs: remove .bx--content override

* docs(ui-shell): add note on UI Shell theming

* docs(grid): touch up grid examples

* docs(theme): wrap localStorage in try catch

So that the site still works in Safari with all cookies blocked.

* docs: use prefixed all.css

Without vendor prefixes, some styles are lost in Safari.

* docs: remove svelte-preprocess from svelte.config.js
2022-04-02 11:45:29 -07:00
metonym
5209f329bd
build(types): copy .d.ts files from src to types (#1218) 2022-03-27 13:26:13 -07:00
metonym
6986aac1be
breaking: remove legacy optimizeCarbonImports preprocessor (#1217) 2022-03-27 09:30:15 -07:00
metonym
ade0557448
feat: upgrade carbon-components to v10.56.0 (#1213)
* chore(deps-dev): upgrade carbon-components to v10.56.0

* feat(progress-bar): add kind prop

* Run "yarn build:docs"

* test(progress-bar): assert kind prop
2022-03-27 08:27:23 -07:00
metonym
21714d0e3a
breaking: remove deprecated props and components (#1191) 2022-03-27 08:21:58 -07:00
metonym
2df7b92269
feat(toolbar-search): support auto-filterable rows (#1179)
Closes #591
2022-03-19 12:01:03 -07:00
metonym
1017e80198
feat(multi-select): make MultiSelect slottable (#1183) 2022-03-19 09:15:58 -07:00
metonym
f5594daba6
feat(dropdown): make Dropdown slottable (#1182) 2022-03-19 09:15:52 -07:00