Commit graph

1913 commits

Author SHA1 Message Date
metonym
aa5be09361 Merge branch 'next/v11-styles' into next-v11-rebase 2024-03-23 17:12:19 -07:00
Sam
5031d0b40e feat(layer): first pass at Layer component (#1932)
Closes #1892
2024-03-23 16:48:13 -07:00
Enrico Sacchetti
e4670a1a51 v1.0.0-next.1 2024-03-23 16:48:12 -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
68c19f5f51 v1.0.0-next.0 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
Sam
180f33b907
feat(layer): first pass at Layer component (#1932)
Closes #1892
2024-03-23 15:30:32 -07:00
Eric Liu
b3a4590872 docs: update guidance on carbon-preprocess-svelte 2024-03-23 15:22:02 -07:00
Eric Liu
8a7583e8fc chore(package): normalize repository.url [ci skip]
Run "npm pkg fix" to auto-fix the error.
2024-03-23 14:52:15 -07:00
Eric Liu
40c8ba4449 chore(examples): bump deps 2024-03-23 14:40:01 -07:00
Eric Liu
1fc8fff2d9 v0.85.0 2024-03-23 14:05:12 -07:00
metonym
d5a11489f8
refactor!: use :global() for custom styles (#1940)
* Prefix custom class selectors with `bx--` (primarily used in custom UI Shell components)
* Use `:global` scope so that selector names are not hashed
2024-03-23 13:11:44 -07:00
dependabot[bot]
c1e0d7a3b8
build(deps): bump webpack-dev-middleware from 7.0.0 to 7.1.1 in /examples/webpack (#1939)
build(deps): bump webpack-dev-middleware in /examples/webpack

Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 7.0.0 to 7.1.1.
- [Release notes](https://github.com/webpack/webpack-dev-middleware/releases)
- [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v7.0.0...v7.1.1)

---
updated-dependencies:
- dependency-name: webpack-dev-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-21 12:11:36 -07:00
Eric Liu
acd08cde5c docs(ui-shell): remove unused imports 2024-03-18 14:31:28 -07:00
dependabot[bot]
4f3a1227ed
build(deps): bump follow-redirects from 1.15.5 to 1.15.6 in /examples/webpack (#1938)
build(deps): bump follow-redirects in /examples/webpack

Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-16 09:45:07 -07:00
Eric Liu
240a87a8e9 v0.84.1 2024-03-16 09:42:25 -07:00
Nick Wing
6364b23030
fix(checkbox): forward on:focus, on:blur to Checkbox and InlineCheckbox (#1937) 2024-03-16 09:31:30 -07:00
berndfuhrmann
9132bf8e5a
fix(data-table): loosen sort return type to be a number (#1935)
Fixes #1934

Loosen the `sort` return type from `0 | 1 | -1` to `number`.
2024-03-13 09:55:02 -07:00
Eric Liu
21b1d78d8e chore(examples): bump deps 2024-03-09 08:54:09 -08:00
Eric Liu
8ce0c6b66d v0.84.0 2024-03-07 21:18:33 -08:00
spburtsev
d8bc65163e
feat(ui-shell): support button tooltip in HeaderGlobalAction (#1894)
Closes #1893
2024-03-07 20:37:58 -08:00
metonym
0405edee7d
fix(exports): resolve imports with explicit *.js extension (#1927)
Fixes #1925

Importing using the explicit `.*js` extension will throw an error as these are not included in the package exports map. Normally, this would be acceptable if it's not part of the API.

However, the `optimizeImports` Carbon preprocessor rewrites certain imports (e.g., `breakpoints`) to the source `*.js` file.

```sh
Internal server error: Failed to resolve import "carbon-components-svelte/src/Breakpoint/breakpoints.js" from "src/App.svelte".
```
2024-03-07 20:35:08 -08:00
Enrico Sacchetti
0071990803
v0.83.0 2024-03-06 22:53:25 -05:00
metonym
6152b784c1 fix(search): hoist ignore a11y autofocus comment
In Svelte 5, the comment is ignored when it's above the input element. Setting the comment at the top-level resolves the issue.
2024-03-06 22:49:27 -05:00
metonym
8bffc17d65 fix(link)!: do not render p for disabled link
Closes #1924

Svelte 5 will not compile if `div` is nested inside `p` element. Refactor Link to render an `a` instead of `p` when disabled.
2024-03-06 22:49:27 -05:00
metonym
a0d5028540 fix: avoid using reserved $ for Svelte 5 compat
Co-Authored-By: Eric Fulton <5297269+Sahasrara@users.noreply.github.com>
2024-03-06 22:49:27 -05:00
Eric Liu
96aef1705c ci: upgrade Node to 20.x 2024-03-05 20:58:51 -08:00
Eric Liu
de9e71178b ci: upgrade actions/cache to v4 2024-03-05 20:58:51 -08:00
metonym
91c27d48bf
docs(tag): add "Tooltip in a tag" example (#1922) 2024-03-05 20:55:06 -08:00
Francine Lucca
44a2989dff
chore(deps): add @ibm/telemetry-js (#1912) 2024-02-29 15:09:13 -08:00
metonym
0ef0f9b593 v0.82.11 2024-02-26 07:58:47 -08:00
Eric Liu
15f0e03c43 docs(button): add description to "Custom element" 2024-02-25 14:11:51 -08:00
Eric Liu
e8d4ed0382 docs(button): add "Link button with icon" example 2024-02-25 14:11:51 -08:00
Eric Liu
9aabe3cbbb fix(toast-notification): fire on:clear from timeout correctly
Fixes #1914

Co-Authored-By: brunnerh <brunnerh@users.noreply.github.com>
2024-02-25 13:38:46 -08:00
Eric Liu
ced9673681 docs(toast-notification): add "Autoclose" example 2024-02-25 13:38:46 -08:00
Eric Fulton
2404244221
fix(overflow-menu): use offsetWidth, offsetHeight to compute menu dimensions (#1913) 2024-02-25 10:21:54 -08:00
Eric Liu
c6af8bdafe docs(image-loader): add "Dynamic image source" example 2024-02-24 13:40:02 -08:00
Eric Liu
0f318aac77 fix(image-loader): updated src should update the image
Fixes #1677

The `ImageLoader` image should correctly update if `src` changes.
2024-02-24 13:40:02 -08:00
metonym
4e6bfd0612
docs(code-snippet): add "Custom show more/less text" example (#1918) 2024-02-24 10:39:14 -08:00
Eric Liu
1901bcddb6 docs(code-snippet): add "Hidden copy, show more buttons" example 2024-02-24 10:24:59 -08:00
Eric Liu
79b0f8dbf0 docs(code-snippet): add "Hidden show more button" example
Related #1536
2024-02-24 10:24:59 -08:00
Eric Liu
4085536189 fix(code-snippet): showMoreLess={false} should hide button
Fixes #1536

If `showMoreLess` is explicitly `false` for multi-line code snippets, the button should not be shown at all.
2024-02-24 10:24:59 -08:00
metonym
17f4c49519 v0.82.10 2024-02-12 14:09:40 -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
Eric Liu
5c95891079 chore(deps-dev): bump svelte, svelte-check 2024-02-10 20:33:42 -08:00
Eric Liu
c35036011e chore(examples): bump deps 2024-02-10 20:31:01 -08:00
metonym
5a758b5c60 v0.82.9 2024-02-07 14:40:41 -08:00
metonym
4ad522c197
fix(context-menu): prevent on:contextmenu default behavior only when opening menu (#1911)
Fixes #1909
2024-02-07 14:37:44 -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
Enrico Sacchetti
0ea318046a v1.0.0-next.1 2024-01-17 11:03:48 -05:00