From 435fb63fa3c0977e20643d6f4aa2d9d473eb6a5a Mon Sep 17 00:00:00 2001 From: msmx-mnakagawa Date: Fri, 23 May 2025 11:45:17 +0900 Subject: [PATCH 001/245] (Badge): update a classname --- src/scripts/Badge.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/Badge.tsx b/src/scripts/Badge.tsx index 18cc375ca..d753be912 100644 --- a/src/scripts/Badge.tsx +++ b/src/scripts/Badge.tsx @@ -13,7 +13,7 @@ export type BadgeProps = { * */ export const Badge: FC = ({ type, label, ...props }) => { - const typeClassName = type ? `slds-theme_${type}` : null; + const typeClassName = type ? `slds-badge_${type}` : null; const badgeClassNames = classnames('slds-badge', typeClassName); return ( From f71f5b7255f95b103fff3b6c43597c04c0644de4 Mon Sep 17 00:00:00 2001 From: msmx-mnakagawa Date: Fri, 23 May 2025 11:45:56 +0900 Subject: [PATCH 002/245] (Badge): remove `default` type that isn't used for a classname --- src/scripts/Badge.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/Badge.tsx b/src/scripts/Badge.tsx index d753be912..d827e397c 100644 --- a/src/scripts/Badge.tsx +++ b/src/scripts/Badge.tsx @@ -5,7 +5,7 @@ import classnames from 'classnames'; * */ export type BadgeProps = { - type?: 'default' | 'shade' | 'inverse'; + type?: 'shade' | 'inverse'; label?: string; } & HTMLAttributes; From bb994c2798e9911225fea238b2fcfea5939cd707 Mon Sep 17 00:00:00 2001 From: msmx-mnakagawa Date: Fri, 23 May 2025 11:46:52 +0900 Subject: [PATCH 003/245] (Badge): remove a `shade` type that doesn't exist as a color variation --- src/scripts/Badge.tsx | 2 +- stories/Badge.stories.tsx | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/scripts/Badge.tsx b/src/scripts/Badge.tsx index d827e397c..dfb440274 100644 --- a/src/scripts/Badge.tsx +++ b/src/scripts/Badge.tsx @@ -5,7 +5,7 @@ import classnames from 'classnames'; * */ export type BadgeProps = { - type?: 'shade' | 'inverse'; + type?: 'inverse'; label?: string; } & HTMLAttributes; diff --git a/stories/Badge.stories.tsx b/stories/Badge.stories.tsx index 6a4601c1e..2c33e4ef4 100644 --- a/stories/Badge.stories.tsx +++ b/stories/Badge.stories.tsx @@ -27,21 +27,6 @@ export const Default: ComponentStoryObj = { }, }; -/** - * - */ -export const Shade: ComponentStoryObj = { - args: { - type: 'shade', - children: 'Badge Label', - }, - parameters: { - docs: { - storyDescription: 'Badge with type: shade', - }, - }, -}; - /** * */ From b789f2d4651f7c0814ade9eef694700bfec7ae46 Mon Sep 17 00:00:00 2001 From: msmx-mnakagawa Date: Fri, 23 May 2025 11:52:04 +0900 Subject: [PATCH 004/245] (Badge): add new types that haven't been available until now --- src/scripts/Badge.tsx | 15 ++++++++-- stories/Badge.stories.tsx | 60 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/src/scripts/Badge.tsx b/src/scripts/Badge.tsx index dfb440274..38320a692 100644 --- a/src/scripts/Badge.tsx +++ b/src/scripts/Badge.tsx @@ -5,7 +5,7 @@ import classnames from 'classnames'; * */ export type BadgeProps = { - type?: 'inverse'; + type?: 'inverse' | 'lightest' | 'success' | 'warning' | 'error'; label?: string; } & HTMLAttributes; @@ -13,8 +13,17 @@ export type BadgeProps = { * */ export const Badge: FC = ({ type, label, ...props }) => { - const typeClassName = type ? `slds-badge_${type}` : null; - const badgeClassNames = classnames('slds-badge', typeClassName); + const typeClassName = /^(inverse|lightest)$/.test(type ?? '') + ? `slds-badge_${type}` + : null; + const themeClassName = /^(success|warning|error)$/.test(type ?? '') + ? `slds-theme_${type}` + : null; + const badgeClassNames = classnames( + 'slds-badge', + typeClassName, + themeClassName + ); return ( {label || props.children} diff --git a/stories/Badge.stories.tsx b/stories/Badge.stories.tsx index 2c33e4ef4..06a94ca90 100644 --- a/stories/Badge.stories.tsx +++ b/stories/Badge.stories.tsx @@ -41,3 +41,63 @@ export const Inverse: ComponentStoryObj = { }, }, }; + +/** + * + */ +export const Lightest: ComponentStoryObj = { + args: { + type: 'lightest', + children: 'Badge Label', + }, + parameters: { + docs: { + storyDescription: 'Badge with type: lightest', + }, + }, +}; + +/** + * + */ +export const Success: ComponentStoryObj = { + args: { + type: 'success', + children: 'Badge Label', + }, + parameters: { + docs: { + storyDescription: 'Badge with type: success', + }, + }, +}; + +/** + * + */ +export const Warning: ComponentStoryObj = { + args: { + type: 'warning', + children: 'Badge Label', + }, + parameters: { + docs: { + storyDescription: 'Badge with type: warning', + }, + }, +}; + +/** + * + */ +export const Error: ComponentStoryObj = { + args: { + type: 'error', + children: 'Badge Label', + }, + parameters: { + docs: { + storyDescription: 'Badge with type: error', + }, + }, +}; From a33572ef423d62a940a90705eae69ad078ab17e7 Mon Sep 17 00:00:00 2001 From: msmx-mnakagawa Date: Fri, 23 May 2025 11:26:40 +0900 Subject: [PATCH 005/245] (BreadCrumbs): remove `.slds-assistive-text` --- src/scripts/BreadCrumbs.tsx | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/scripts/BreadCrumbs.tsx b/src/scripts/BreadCrumbs.tsx index 5c34600eb..2f8ed8dfd 100644 --- a/src/scripts/BreadCrumbs.tsx +++ b/src/scripts/BreadCrumbs.tsx @@ -33,15 +33,12 @@ export const Crumb: FC = ({ /** * */ -export type BreadCrumbsProps = { - label?: string; -} & HTMLAttributes; +export type BreadCrumbsProps = HTMLAttributes; /** * */ export const BreadCrumbs: FC = ({ - label, className, children, ...props @@ -53,14 +50,7 @@ export const BreadCrumbs: FC = ({ return ( ); }; From d9184634e7eea264767732a70b32aee8f59c2aae Mon Sep 17 00:00:00 2001 From: msmx-mnakagawa Date: Fri, 23 May 2025 11:30:21 +0900 Subject: [PATCH 006/245] (BreadCrumbs): add an `aria-label` attribute --- src/scripts/BreadCrumbs.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/BreadCrumbs.tsx b/src/scripts/BreadCrumbs.tsx index 2f8ed8dfd..ccaa40742 100644 --- a/src/scripts/BreadCrumbs.tsx +++ b/src/scripts/BreadCrumbs.tsx @@ -49,7 +49,7 @@ export const BreadCrumbs: FC = ({ ); return ( -