Skip to content

Commit

Permalink
Merge branch 'feature/DES-998-multiple-terms' of https://github.com/A…
Browse files Browse the repository at this point in the history
…msterdam/design-system into feature/DES-998-multiple-terms
  • Loading branch information
dlnr committed Dec 11, 2024
2 parents 58ad1cd + e1700c9 commit 6323d4f
Show file tree
Hide file tree
Showing 13 changed files with 472 additions and 467 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

# The logic below handles the Storybook deploy:
- name: "Restore build artifact: Storybook"
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6
uses: dawidd6/action-download-artifact@80620a5d27ce0ae443b965134db88467fc607b43 # v7
with:
workflow: "lint-test.yml"
name: storybook
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"npm-run-all": "4.1.5",
"plop": "4.0.1",
"postcss": "8.4.49",
"prettier": "3.4.1",
"prettier": "3.4.2",
"rimraf": "6.0.1",
"stylelint": "16.11.0",
"stylelint-config-standard-scss": "13.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"clean": "rimraf dist/"
},
"devDependencies": {
"sass": "1.81.0"
"sass": "1.82.0"
},
"peerDependencies": {
"@amsterdam/design-system-tokens": "workspace:*",
Expand Down
3 changes: 2 additions & 1 deletion packages/css/src/components/overlap/overlap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
display: grid;

> * {
grid-area: 1 / -1;
grid-column: 1 / -1;
grid-row: 1 / -1;
}
}
23 changes: 19 additions & 4 deletions packages/css/src/components/tabs/tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
}

.ams-tabs__list {
background-color: var(--ams-tabs-list-background-color);
border-block-end: var(--ams-tabs-list-border-block-end);
box-shadow: var(--ams-tabs-list-box-shadow);
display: flex;
overflow-x: auto;
}

.ams-tabs__button {
color: var(--ams-tabs-button-color);
cursor: var(--ams-tabs-button-cursor);
display: grid;
font-family: var(--ams-tabs-button-font-family);
font-size: var(--ams-tabs-button-font-size);
font-weight: var(--ams-tabs-button-font-weight);
Expand All @@ -41,7 +41,7 @@

&:disabled {
color: var(--ams-tabs-button-disabled-color);
cursor: var(--ams-tab-button-disabled-cursor);
cursor: var(--ams-tabs-button-disabled-cursor);

@media (forced-colors: active) {
color: GrayText;
Expand All @@ -54,11 +54,26 @@
}

&[aria-selected="true"] {
background-color: var(--ams-tabs-button-selected-background-color);
box-shadow: var(--ams-tabs-button-selected-box-shadow);
color: var(--ams-tabs-button-selected-color);
font-weight: var(--ams-tabs-button-selected-font-weight);

@media (forced-colors: active) {
background-color: SelectedItem;
}
}
}

.ams-tabs__button-label,
.ams-tabs__button-label-hidden {
grid-area: 1 / 1;
}

// This hidden label is used to prevent a layout shift when the tab is selected
// and the button text becomes bold.
.ams-tabs__button-label-hidden {
font-weight: var(--ams-tabs-button-selected-font-weight);
pointer-events: none;
user-select: none;
visibility: hidden;
}
10 changes: 5 additions & 5 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,34 +45,34 @@
"@babel/core": "7.26.0",
"@babel/plugin-transform-runtime": "7.25.9",
"@babel/preset-env": "7.26.0",
"@babel/preset-react": "7.25.9",
"@babel/preset-react": "7.26.3",
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-commonjs": "28.0.1",
"@rollup/plugin-node-resolve": "15.3.0",
"@rollup/pluginutils": "5.1.3",
"@testing-library/dom": "10.4.0",
"@testing-library/jest-dom": "6.6.3",
"@testing-library/react": "16.0.1",
"@testing-library/react": "16.1.0",
"@testing-library/user-event": "14.5.2",
"@types/jest": "29.5.14",
"@types/lodash": "4.17.13",
"@types/react": "18.3.12",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"next": "15.0.3",
"next": "15.0.4",
"npm-run-all": "4.1.5",
"postcss": "8.4.49",
"react": "18.3.1",
"react-dom": "18.3.1",
"rollup": "4.28.0",
"rollup": "4.28.1",
"rollup-plugin-delete": "2.1.0",
"rollup-plugin-dts": "6.1.1",
"rollup-plugin-filesize": "10.0.0",
"rollup-plugin-node-externals": "7.1.3",
"rollup-plugin-node-polyfills": "0.2.1",
"rollup-plugin-peer-deps-external": "2.2.4",
"rollup-plugin-typescript2": "0.36.0",
"sass": "1.81.0",
"sass": "1.82.0",
"tslib": "2.8.1"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import clsx from 'clsx'
import { forwardRef, useEffect, useId, useImperativeHandle, useMemo, useRef, useState } from 'react'
import type { ForwardedRef, HTMLAttributes, PropsWithChildren, ReactNode } from 'react'
import type { ForwardedRef, HTMLAttributes, PropsWithChildren } from 'react'
import { TabsButton } from './TabsButton'
import { TabsContext } from './TabsContext'
import { TabsList } from './TabsList'
Expand All @@ -25,7 +25,7 @@ const TabsRoot = forwardRef(

const allTabs = useMemo(() => {
if (!Array.isArray(children)) return []
return (children[0].props.children as ReactNode[]).map((child) => child)
return children[0].props.children
}, [children])

useEffect(() => {
Expand Down
5 changes: 4 additions & 1 deletion packages/react/src/Tabs/TabsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export const TabsButton = forwardRef(
role="tab"
tabIndex={activeTab === tab ? 0 : -1}
>
{children}
<span aria-hidden="true" className="ams-tabs__button-label-hidden">
{children}
</span>
<span className="ams-tabs__button-label">{children}</span>
</button>
)
},
Expand Down
Loading

0 comments on commit 6323d4f

Please sign in to comment.