Skip to content
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

Release 3.1.0 #1160

Merged
merged 187 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
14a5477
Memoize DatePicker props to prevent MonthTable to reset input values …
jorilindell Sep 18, 2023
86fa42c
HDS-1949 fix heading sizes table
mikkojamG Oct 5, 2023
0871f29
HDS-1939 doc site add space beneath table
mikkojamG Oct 5, 2023
e04f8f9
fix: Fixing automatically closing notification overlap on storybook e…
arpargo Oct 5, 2023
3b0be40
HDS-1922 fix button previews
mikkojamG Oct 5, 2023
71dec8a
HDS-1902 fix link previews
mikkojamG Oct 5, 2023
13b4978
HDS-1867 fix inline link core preview
mikkojamG Oct 5, 2023
38d43a9
Merge pull request #1138 from City-of-Helsinki/HDS-1939/bug-header-co…
mikkojamG Oct 6, 2023
e533ff4
Merge pull request #1142 from City-of-Helsinki/HDS-1902/bug-doc-broke…
mikkojamG Oct 6, 2023
f9d0440
Merge pull request #1136 from City-of-Helsinki/HDS-1949/bug-header-ty…
mikkojamG Oct 6, 2023
447d81b
HDS-1867 react inline link font size
mikkojamG Oct 6, 2023
5be59a8
fix: updated Loki reference images for Notification component
arpargo Oct 6, 2023
8a896a5
Fix: Fixed notifications expanding too wide on example site and regen…
arpargo Oct 6, 2023
11acef6
Merge pull request #1141 from City-of-Helsinki/HDS-1922/bug-doc-broke…
mikkojamG Oct 6, 2023
64ddbea
Merge pull request #1139 from City-of-Helsinki/HDS-1955
arpargo Oct 9, 2023
d4c9238
HDS-1867 use font size variable
mikkojamG Oct 9, 2023
9805eda
Merge pull request #1143 from City-of-Helsinki/HDS-1867/bug-doc-link-…
mikkojamG Oct 9, 2023
3345939
Remove underline from "a href" hds-button components
Arkkimaagi Oct 9, 2023
a4f01c2
(HDS-1872) this-is-hds page is visible and styles are fixed
harriplappalainen Oct 9, 2023
ba8e9d7
(HDS-1872) Fix custom Hero styling in this-is-hds page
harriplappalainen Oct 11, 2023
ea3f782
Fix input buttons focus by using the correct variable name
harriplappalainen Oct 11, 2023
a30df70
Clarify Hero docs about customising diagonalKoros variants background…
harriplappalainen Oct 11, 2023
3aac5af
Merge pull request #1144 from Arkkimaagi/patch-1
harriplappalainen Oct 11, 2023
9e6a139
Fix cookieconsent button focus
harriplappalainen Oct 12, 2023
77ca7d4
(HDS-1815) add readonly to allowed attributes in PlayGround
mrTuomoK Oct 12, 2023
2fe3531
HDS-1909 fix items more than one row
mikkojamG Oct 6, 2023
32fc0d5
HDS-1909 add test nav items to cause overflow
mikkojamG Oct 9, 2023
184950e
HDS-1909 position left negative header margin
mikkojamG Oct 12, 2023
40969ae
HDS-1909 reverting Header stories
mikkojamG Oct 12, 2023
0c660bd
Merge pull request #1146 from City-of-Helsinki/hds-1872-fix-this-is-h…
harriplappalainen Oct 13, 2023
8938ed2
Merge pull request #1119 from jorilindell/fix/date-input-current-month
harriplappalainen Oct 16, 2023
6b2618a
Merge pull request #1147 from City-of-Helsinki/hds-1945-fix-input-but…
harriplappalainen Oct 17, 2023
d80fce7
Use alert-fill-icon in Core ErrorSummary examples
minevala Jan 2, 2023
ee0228b
Replace single validation image with Playground live example
minevala Jan 3, 2023
e8be6b3
Replace multi-fields validation image with Playground live example
minevala Jan 3, 2023
0fbfe0a
Fix error examples
harriplappalainen Aug 21, 2023
cdf5a41
Update validation summary pattern section
harriplappalainen Aug 22, 2023
018072d
Update validation of multiple fields section and add descriptive text…
harriplappalainen Aug 22, 2023
0cbefcf
Simplify naming validations and fix dates example
harriplappalainen Aug 28, 2023
1c441b8
Ran scaffold script for new login component
May 8, 2023
f711886
Added oidc-client-ts to package.json
Apr 15, 2023
696a8b1
Added await-to-js to package.json
Apr 15, 2023
5afa037
Added jest-fetch-mock devDependency
Apr 15, 2023
ffd9c49
Window.location mock
Apr 16, 2023
8f620cc
Mock openId configuration
Apr 16, 2023
ef263a0
Storybook middleware to handle oidc return url
Apr 16, 2023
5fdf798
OidcClient with login() and getUserManager functions
May 8, 2023
11c1fae
LoginContext to be used to with hooks
Apr 16, 2023
4521a67
Added a warning for using Login stories in an iframe
Apr 16, 2023
dd1e01c
Error class for OidcClient
May 8, 2023
3d5ba93
Handle signin callback
May 8, 2023
40ec664
Callback handler component and story
May 8, 2023
1e23d68
Syncronous getUser function
May 8, 2023
0a2f6ef
useAuthenticatedUser hook
May 8, 2023
1d94891
Test helper for get data from jest.Mock
May 8, 2023
77548f7
Simple signal (event) emitter
May 8, 2023
2093344
Better context handling to beacon
May 8, 2023
c2c32c1
Added useSignalListener hook
May 9, 2023
276af0d
Emit stateChange events from oidcClient
May 9, 2023
045915f
Emit errors
May 9, 2023
aa8fab2
Added logout function and component
May 9, 2023
b04492a
Emit events.
May 9, 2023
3135cbc
useRenewalPromise to handle user renewal
May 9, 2023
885b5c7
Emit events and errors with proper types
May 10, 2023
1589294
Emit events and errors when user renewal is in progress.
May 10, 2023
0baa4b4
Added library for http return types
Apr 17, 2023
7ff4195
Utility function to abort fetches.
Apr 20, 2023
22aa66e
HttpPoller utility
Apr 20, 2023
ec89aab
Added user session poller
Apr 20, 2023
b28f69e
New signal shortcuts
May 11, 2023
5709e08
Additions to fetchMock test util
May 11, 2023
f396852
Fake OidcClient
May 11, 2023
d9e0667
Session poller
May 11, 2023
1660d16
Wrap httpPoller to a promise.
May 12, 2023
6f56540
Make initSignalType and re-arrange functions
May 12, 2023
3cb3d70
Change oidc client events
May 12, 2023
b082b4e
New test and signal utils
May 14, 2023
cba1a04
New api tokens client
May 14, 2023
c1ef1cd
Fix oidcClient test util login/logout handling
May 15, 2023
9f1930c
Session polling should pause while user is renewed
May 15, 2023
588c0a7
Test whole setup
May 15, 2023
91ff30f
Added oidcClient.isAuthenticated
May 15, 2023
add5f93
Added getAmr() function
May 15, 2023
4639acb
Added getToken function
May 15, 2023
cb05656
Hook for amr caching
May 15, 2023
27ea324
Components for conditional rendering
May 15, 2023
7c7d1bf
Hooks for ApiTokensClient
May 16, 2023
cf293b6
Util to compare object key/value pairs partially
May 16, 2023
44273f4
Two hooks for tracking signals
May 17, 2023
3fb2cc6
Reset signal stored in the hook.
May 17, 2023
4981095
Change beacon to use partiallyCompareObjects in triggers
May 18, 2023
586a93a
New hook for getting connected modules
May 19, 2023
63198de
Signal helpers for easier usage
May 19, 2023
bfd1694
Check listeners are memoized properly
May 21, 2023
382d558
Move common hooks test code to util
May 21, 2023
0a72082
Move stateChange signal code from oidcClient to beacon
May 22, 2023
b2decb5
Add emitStateChange to dedicatedBeacon
May 22, 2023
f9783fa
Added noOidcClient option to hooks testUtil
May 22, 2023
ea14ffd
Better stories
May 17, 2023
fc47362
Added waitForSignals function
May 22, 2023
b9d32d5
Remove emitAsync part one: make it sync
May 22, 2023
f3810c5
Remove emitAsync part two: removed emitAsync
May 22, 2023
46ed8a3
Use hooks.testUtil in apiTokensClient hook tests
May 22, 2023
e51d50c
Unexpose emit to hooks.
May 22, 2023
2be21e9
Fix problem with oidcClient tests not exiting properly
May 22, 2023
57d9e1d
Queue listeners added during emits
May 23, 2023
9f4f90c
Docs to the site
May 23, 2023
27c8633
OidcClient states as const
May 24, 2023
3e47991
OidcClient evenst as const
May 24, 2023
9b90be6
ApiTokensClient events as const
May 24, 2023
8cda4de
Error types as consts
May 24, 2023
3ad737f
Emit sessionPollerEvents
May 24, 2023
6339828
SessionPoller hooks
May 24, 2023
feb2178
Code documention for exported functions
May 25, 2023
354085b
Unify all signal utility functions
May 26, 2023
f489d3c
AddListener accepts trigger as a function
May 27, 2023
577767c
Improved or new hook hooks for tracking signals
May 27, 2023
732cced
New components
May 27, 2023
7a16ec1
Helper dialog for session ending
May 28, 2023
2d97159
Fix random mockedWindowControls test failures
May 28, 2023
8fba4a9
Added catch() to story promises
May 28, 2023
137f07d
Callback handler must handle alreay logged in state
May 28, 2023
bd643ca
Clean story and add session end simulation.
May 28, 2023
db55be4
Handle and emit login error
May 28, 2023
f6fb848
Login button shows errors
May 28, 2023
b6109a8
One component for creating login context with all modules.
May 28, 2023
4d9e410
Move hooks and their test files.
May 28, 2023
70a8382
Vanilla js version of the system build up
May 29, 2023
d44f094
Fix bug in LoginContext
May 29, 2023
9d7c56d
Removed default exports
May 29, 2023
b3c131d
Moved signalParsers file
May 29, 2023
fd88ac9
Proper index.ts
May 29, 2023
7ea4740
Correct iframe redirects
May 29, 2023
66b73d4
Use only imports from index.ts in Login.stories
May 30, 2023
8655ff2
Fix crypto error
May 30, 2023
bf61e07
Added login component preview image
Jul 7, 2023
64598e0
fixup! Added oidc-client-ts to package.json
Jul 7, 2023
e0d6f3a
Loki images of the pre-login views.
Jul 7, 2023
99c9e4e
Added an AnchorLink component
Sep 4, 2023
84c9b2a
HDS-1909 dynamically set dropdown position
mikkojamG Oct 18, 2023
24655cb
Update invalid, info and success styles in core and react
harriplappalainen Oct 13, 2023
8c22541
Fix RadioButton doc sites props table
harriplappalainen Oct 13, 2023
bfba67d
More invalid and valid stories
harriplappalainen Oct 13, 2023
54789ef
HDS-1972 add multi-page form links
laurakarhu Oct 18, 2023
89263aa
HDS-1909 apply dynamic positioning only to first level dropdowns
mikkojamG Oct 18, 2023
5e0520f
Fix multiple input field validation example
harriplappalainen Oct 18, 2023
6447bfa
HDS-1970
laurakarhu Oct 18, 2023
acef650
HDS-1909 dropdownMenu box-sizing border-box
mikkojamG Oct 18, 2023
bd2a2a7
HDS-1909 less agressive position toggling
mikkojamG Oct 18, 2023
11a9553
Merge pull request #1148 from City-of-Helsinki/HDS-1815-fix-site-text…
mrTuomoK Oct 19, 2023
3aefc0a
HDS-1909 use window outerWidth instead of innerWidth
mikkojamG Oct 19, 2023
6642138
(HDS-1763) fix tag styles to match designs,
mrTuomoK Oct 23, 2023
ee4edf8
HDS-1909 set window outerWidth back to innerWidth
mikkojamG Oct 23, 2023
55a2053
Merge pull request #932 from City-of-Helsinki/hds-1506-unify-error-me…
harriplappalainen Oct 23, 2023
76ed612
Merge pull request #1149 from City-of-Helsinki/HDS-1909/bug-header-dr…
mikkojamG Oct 23, 2023
2133ec7
(HDS-1763) update styles to use variables for line-heights,
mrTuomoK Oct 23, 2023
2b285b4
(hds-1467) Documentation update
Aug 24, 2023
4ee58a5
(hds-1467) Moved components to own folder
Aug 27, 2023
d42b868
(hds-1467) Added JSDocs to components
Aug 27, 2023
43052d9
(hds-1467) Clean up code and stories suggested in the PR
Aug 27, 2023
e8f8e52
(hds-1467) Change tests suggested in the PR
Aug 27, 2023
c1e2385
(hds-1467) Fix and combine mixed hook tests
Sep 5, 2023
0cf6cc0
(hds-1467) Fix TS error by type assertion
harriplappalainen Sep 20, 2023
35a3c25
(hds-1467) Update stories and components to HDS 3.0.0.
NikoHelle Oct 18, 2023
2119d52
(hds-1467) New loki images
NikoHelle Oct 18, 2023
cf5f558
Merge pull request #1145 from City-of-Helsinki/HDS-1763-fix-rounded-t…
mrTuomoK Oct 25, 2023
966fb45
(hds-1984) Added tests for LanguageContext
NikoHelle Oct 25, 2023
908fdae
(hds-1984) Call "onDidChangeLanguage" only when language actually cha…
NikoHelle Oct 25, 2023
3850e9c
Merge pull request #1151 from City-of-Helsinki/HDS-1970-Update-compon…
laurakarhu Oct 26, 2023
175560b
(HDS-1892) Added onLogoClick callback to footer
NikoHelle Oct 26, 2023
65f22cf
(HDS-1817) Fixed missing key prop errors in StepByStep
NikoHelle Oct 27, 2023
7f916d4
(HDS-1817) Update and fix docs
NikoHelle Oct 27, 2023
719c483
(HDS-1817) Fix warnings about "tabindex" and "class"
NikoHelle Oct 27, 2023
bd7bb6e
(HDS-1974) Align Container with header
NikoHelle Oct 26, 2023
30f36f4
(HDS-1974) Use the container to align breadcrumb in Header
NikoHelle Oct 26, 2023
4abad6e
(HDS-1974) Update Loki images
NikoHelle Oct 26, 2023
908ae93
Merge pull request #1158 from City-of-Helsinki/HDS-1817-step-by-step-…
NikoHelle Oct 31, 2023
29756fb
Merge pull request #1155 from City-of-Helsinki/hds-1984-lang-change-fix
NikoHelle Oct 31, 2023
1a6d126
Merge pull request #1157 from City-of-Helsinki/HDS-1892-footer-logo-c…
NikoHelle Oct 31, 2023
e7ad609
Merge pull request #1156 from City-of-Helsinki/HDS-1974-container-ali…
NikoHelle Oct 31, 2023
280296a
Merge pull request #1150 from City-of-Helsinki/hds-1705-improve-input…
harriplappalainen Oct 31, 2023
7e933aa
(hds-1467) Changed status to draft
NikoHelle Oct 31, 2023
2fe1c3f
(hds-1467) Update yarn.locks
NikoHelle Oct 31, 2023
4ad1bcc
Merge pull request #1042 from City-of-Helsinki/hds-1467-login-system
NikoHelle Oct 31, 2023
eddd80e
release-3.1.0 Version bump
NikoHelle Oct 31, 2023
7e3dac9
Updated CHANGELOG
NikoHelle Oct 31, 2023
08d4173
Change Login component settings to work with prod urls
NikoHelle Oct 31, 2023
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
113 changes: 110 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,100 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.1.0] - October, 31, 2023

### React

#### Added

- [Footer] Added onLogoClick callback
- [Container] Added a new attribute to align it with Header
- [Login] New login components and utilities to provide OIDC authentication and api tokens

#### Changed

- [Checkbox, DateInput, Dropdowns, FileInput, NumberInput, PasswordInput, PhoneInput, SelectionGroup, NumberInput, TextInput, TextArea, TimeInput] Improved readability and accessibility of error, success and info states

#### Fixed

harriplappalainen marked this conversation as resolved.
Show resolved Hide resolved
- [StepByStep] Fixed React warnings about missing keys.
- [Header] onDidChangeLanguage is now called only when language is changed.
- [Header] Fixed header dropdown overflow issues
- [DatePicker] Fixed selected date getting reseted in a controlled state
- [CookieConsent, Dropdown, FileInput, NumberInput, SearchInput, TextInput] Fixed button focus inside input components
- [Tag] Fixed margins with several lines long texts

### Core

#### Changed

- [Checkbox, NumberInput, PasswordInput, PhoneInput, SelectionGroup, NumberInput, TextInput, TextArea] Improved readability and accessibility of error, success and info states

#### Fixed

- [Tag] Border-radiuses and paddings to match designs
- [Link] Removed underline when using Button styles with Link

### Documentation

#### Added

- [Footer] Added onLogoClick callback
- [Form validation] Live examples for validation pattern
- [Form validation] Links to multi-page guidelines and components
- [Login] Documentation for the new Login system

#### Changed

- [FileInput] Changed from beta to stable
- [Pagination] Changed from beta to stable
- [SearchInput] Changed from beta to stable

### Fixed

Several new line issues breaking the documentation and examples
This is HDS -competition page was broken and not available
Unified error message implementation, examples and documentation
harriplappalainen marked this conversation as resolved.
Show resolved Hide resolved

### Design kit

### Figma

We're excited to announce the availability of the HDS UI Kit in Figma (.fig) format! You can access it within the "hds-design-kit.zip" and import the file to use in your projects. Please be aware that this Figma file is independent and won't receive automatic updates from the original file.

If you're looking for an updatable Figma library, feel free to get in touch with the HDS team. An updatable version is accessible with Helsinki licenses, and we plan to make it available as a community file in the future. Stay tuned for updates!

#### Changed

- [Color styles] Quality of life improvement: added hex codes after color names for ease of access
- [Color styles] Changed greyscale color names to match token names, e.g. Grey-10 -> Black-10
- [Highlight] Changed the Quote to be a variant of Highlight component, not its own component, to match implementation

[HDS Form Components] Updated error, success and info text shared symbols in all input components

#### Removed

[Radio button] Removed error states for individual radio buttons, because individual radio buttons should not have an error state in any use cases.

#### Fixed

- [Highlight] Fixed paddings on all sizes and font, line-height to match implementation
- [Highlight] Linked text properties back to quote variants
- [Highlight] Correct color style attached to text color

### Sketch/Abstract

#### Changed

- [HDS Form Components] Updated error, success and info text shared symbols in all input symbols

#### Removed

- [Radio button] Removed error states for individual radio buttons, because individual radio buttons should not have an error state in any use cases.

#### Fixed

- [Dropdown] Border for dropdown menu fixed from 2px to 1px and example updated according to that

## [3.0.0] - October, 4, 2023

Expand Down Expand Up @@ -38,7 +132,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
#### Changed

- Supported browserlist updated
- [RadioButton] Default value is not recommended anymore
- [RadioButton] Default value is not recommended anymore
- [Footer] Redesigned and rebuilt

#### Fixed
Expand Down Expand Up @@ -68,7 +162,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- [Header] Added new Header and its sub-components' documentations
- [Footer] Added new Footer and its sub-components' documentations
- Added documention for focus colour tokens
- Added documention for focus colour tokens
- Added navigation pattern guidelines
- Added new releases page
- Added new guide how to migrate to 3.0.0
Expand Down Expand Up @@ -101,7 +195,7 @@ There is a brand new Figma library available. The licenses are checked and provi
#### Added

- [Footer] New symbols following the hel.fi visual style. New symbols also include changes to all Footer sections. Service title is now mandatory. The Helsinki logo moved to the Base section. Separate symbols for Footers with custom content (e.g. partner information). New variant for the Utility section which allow more utility links and link groups
- [Header] New component replacing HDS Navigation
- [Header] New component replacing HDS Navigation

#### Changed

Expand All @@ -120,37 +214,44 @@ There is a brand new Figma library available. The licenses are checked and provi
### React

#### Added

- [Header] New Header component to wrap all its child components
- [Header.UniversalBar] Optional component to display useful quick links
- [Header.ActionBar] Mandatory component to display service logo, language selection, search and user login
- [Header.NavigationMenu] Mandatory component to display navigation links

#### Changed

- [LinkBox] Property name `withBorder` changed to `border`
- [Koros] Renamed variants Wave to Vibration and Storm to Wave
- Supported browserlist updated

#### Deprecated

- [Navigation] New Header component will be the replacement
- [Tag] Rectangular version (default)
- [StatusLabel] Rectangular version (default)

### Core

#### Changed

- [Koros] Renamed variants Wave to Vibration and Storm to Wave

#### Deprecated

- [Tag] Rectangular version (default)
- [StatusLabel] Rectangular version (default)

### Documentation

#### Added

- [Header] Documentation - still a work in progress
- Helpful tooltip to explain statuses

#### Changed

- [Koros] Renamed variants Wave to Vibration and Storm to Wave

### Design kit
Expand All @@ -164,29 +265,35 @@ There is a brand new Figma library available. The licenses are checked and provi
### React

#### Added

- [Highlight] New component for quotes and text highlights

### Core

#### Added

- [Highlight] New component for quotes and text highlights

### Documentation

#### Added

- [Highlight] Documentation for new Highlight component
- Document tokens for focus colours

#### Changed

- Improved docs for creating new react components
- Updated contributing guide

#### Fixed

- Updated package dependencies

### Design kit

#### Added

- Figma API icon library export script

## [2.16.0] - June, 28, 2023
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hds-core",
"version": "3.0.0",
"version": "3.1.0",
"description": "Core styles for the Helsinki Design System",
"homepage": "https://github.com/City-of-Helsinki/helsinki-design-system#readme",
"license": "MIT",
Expand Down Expand Up @@ -30,7 +30,7 @@
"@storybook/manager-webpack5": "^6.5.16",
"copyfiles": "2.2.0",
"cssnano": "4.1.10",
"hds-design-tokens": "3.0.0",
"hds-design-tokens": "3.1.0",
"normalize.css": "8.0.1",
"postcss": "8.2.15",
"postcss-cli": "8.3.1",
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/components/button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
min-width: var(--min-size);
padding: 0 var(--spacing-2-xs);
position: relative;
text-decoration: none;

/*
* Normalize.css rule
Expand Down
16 changes: 9 additions & 7 deletions packages/core/src/components/checkbox/checkbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,24 +137,26 @@

/* ERROR */
.hds-checkbox__error-text {
color: var(--color-error);
display: block;
background-color: var(--color-error-light);
border-left: 8px solid var(--color-error);
color: var(--color-black);
display: flex;
flex-basis: 100%;
font-size: var(--fontsize-body-m);
margin-top: var(--spacing-2-xs);
padding-left: calc(var(--icon-size) + var(--spacing-2-xs));
padding: var(--spacing-2-xs);
position: relative;
}

.hds-checkbox__error-text:before {
background: var(--color-error);
content: '';
display: inline-block;
height: var(--icon-size);
left: 0;
mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cg fill='none' fill-rule='evenodd'%3E %3Crect width='24' height='24'/%3E %3Cpath fill='currentColor' d='M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M13,16 L13,18 L11,18 L11,16 L13,16 Z M13,6 L13,14 L11,14 L11,6 L13,6 Z'/%3E %3C/g%3E %3C/svg%3E");
margin-right: var(--spacing-2-xs);
-webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.175 3.45608C11.5239 2.86969 12.3977 2.84875 12.7842 3.39325L12.825 3.45608L21.8771 18.6666C22.2202 19.2432 21.8055 19.951 21.1235 19.9976L21.052 20H2.94799C2.24813 20 1.7987 19.3114 2.09013 18.7267L2.12295 18.6666L11.175 3.45608ZM13 16V18H11V16H13ZM13 8.5V14.5H11V8.5H13Z' fill='currentColor'%3E%3C/path%3E %3C/svg%3E");
mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.175 3.45608C11.5239 2.86969 12.3977 2.84875 12.7842 3.39325L12.825 3.45608L21.8771 18.6666C22.2202 19.2432 21.8055 19.951 21.1235 19.9976L21.052 20H2.94799C2.24813 20 1.7987 19.3114 2.09013 18.7267L2.12295 18.6666L11.175 3.45608ZM13 16V18H11V16H13ZM13 8.5V14.5H11V8.5H13Z' fill='currentColor'%3E%3C/path%3E %3C/svg%3E");
pointer-events: none;
position: absolute;
top: 0;
width: var(--icon-size);
}

Expand Down
8 changes: 3 additions & 5 deletions packages/core/src/components/checkbox/checkbox.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import '../selection-group/selection-group.css';
const errorTextId = 'checkbox-error-text';
const helperTextId = 'checkbox-helper-text';
const getLabel = (id = 'input', label = 'Option') => `<label for="${id}" class="hds-checkbox__label">${label}</label>`;
const getHelperText = (text = 'Assistive text') => `<span id="${helperTextId}" class="helper-text">${text}</span>`;
const getErrorText = (text = 'Error text') => `<span id="${errorTextId}" class="hds-checkbox__error-text">${text}</span>`;

export default {
title: 'Components/Checkbox',
Expand Down Expand Up @@ -56,10 +54,10 @@ export const SelectedDisabled = () => `
SelectedDisabled.storyName = 'Selected & disabled';

export const Invalid = () => `
<div class="hds-checkbox">
<div class="hds-checkbox" style="width: 300px">
<input type="checkbox" id="checkbox6" class="hds-checkbox__input" value="baz" aria-describedby="${errorTextId}" />
${getLabel('checkbox6')}
${getErrorText()}
<span id="number-input-error" class="hds-checkbox__error-text">Invalid value</span>
</div>
`;

Expand Down Expand Up @@ -129,6 +127,6 @@ export const WithHelperText = () => `
<div class="hds-checkbox">
<input type="checkbox" id="checkbox7" class="hds-checkbox__input" value="foo" aria-describedby="${helperTextId}"/>
${getLabel('checkbox7')}
${getHelperText()}
<span id="${helperTextId}" class="helper-text">Assistive text</span>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const Default = () => `
<section aria-label="Error summary" class="hds-notification hds-notification--error">
<div class="hds-notification__content">
<div class="hds-notification__label" role="heading" aria-level="2" tabindex="-1">
<span class="hds-icon hds-icon--alert-circle" aria-hidden="true"></span>
<span class="hds-icon hds-icon--alert-circle-fill" aria-hidden="true"></span>
<span>Form contains following errors</span>
</div>
<div class="hds-notification__body hds-error-summary__body">
Expand All @@ -36,7 +36,7 @@ export const Large = () => `
<section aria-label="Error summary" class="hds-notification hds-notification--error hds-notification--large">
<div class="hds-notification__content">
<div class="hds-notification__label" role="heading" aria-level="2" tabindex="-1">
<span class="hds-icon hds-icon--alert-circle" aria-hidden="true"></span>
<span class="hds-icon hds-icon--alert-circle-fill" aria-hidden="true"></span>
<span>Form contains following errors</span>
</div>
<div class="hds-notification__body hds-error-summary__body">
Expand Down
30 changes: 30 additions & 0 deletions packages/core/src/components/number-input/number-input.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,33 @@ export const Default = () => `
<span class="hds-text-input__helper-text">Assistive text</span>
</div>
`;

export const Invalid = () => `
<div class="hds-text-input">
${getLabel('input1')}
<div class="hds-text-input__input-wrapper">
<input
id="input1"
class="hds-text-input__input"
type="number"
/>
</div>
<span id="number-input-error" class="hds-text-input__error-text">Invalid value</span>
<span class="hds-text-input__helper-text">Assistive text</span>
</div>
`;

export const Success = () => `
<div class="hds-text-input">
${getLabel('input1')}
<div class="hds-text-input__input-wrapper">
<input
id="input1"
class="hds-text-input__input"
type="number"
/>
</div>
<span id="number-input-success" class="hds-text-input__success-text">Value is valid</span>
<span class="hds-text-input__helper-text">Assistive text</span>
</div>
`;
Loading
Loading