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

Erstattet Radix tabs med intern implementasjon #2621

Merged
merged 92 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
46df36a
:tada: Ny hook og API 'descendants'
KenAJoh Dec 28, 2023
9e93ef0
Merge branch 'main' into use-descendants
KenAJoh Jan 10, 2024
807c347
Merge branch 'main' into use-descendants
KenAJoh Jan 13, 2024
88da011
:memo: Bedre storiers
KenAJoh Jan 13, 2024
ad37156
:tada: Setup for ny tabs
KenAJoh Jan 13, 2024
1dcc419
:art: Setup context
KenAJoh Jan 13, 2024
a198469
:art: useTabs-hook
KenAJoh Jan 13, 2024
059e8df
:art: Tablist hook
KenAJoh Jan 13, 2024
b7402c3
:truck: Flyttet tablist i egen mappe
KenAJoh Jan 13, 2024
991d904
:art: TabList
KenAJoh Jan 13, 2024
7149c94
:bug: Fikset import av tabList
KenAJoh Jan 13, 2024
42fc7af
:art: Tabs.Tab implementert
KenAJoh Jan 13, 2024
98b9ef3
:art: Tabs.TabPanel implementert
KenAJoh Jan 13, 2024
a9ccf45
:bug: Fikset import av tabpanel
KenAJoh Jan 13, 2024
d578350
:bug: onOnClick -> onClick
KenAJoh Jan 13, 2024
509b24e
:bug: Fikset keydown-håndtering i tablist
KenAJoh Jan 13, 2024
70053b8
:bug: Fikset plassering av scrollbuttons i overflow
KenAJoh Jan 13, 2024
3e5fe84
:wheelchair: Scrollbutton er nå
KenAJoh Jan 13, 2024
c63c5df
:sparkles: Fitted variant
KenAJoh Jan 13, 2024
ccd7fad
:bug: Fikset imports
KenAJoh Jan 13, 2024
cbe0011
:fire: Fjernet radix-tabs import
KenAJoh Jan 13, 2024
d20498d
:art: Panel-children rendres bare hvis selected
KenAJoh Jan 13, 2024
20834c7
:art: lazy-prop for å bare rendre children i panel hvis selected
KenAJoh Jan 13, 2024
d27e2a7
:art: Tabs.Tab håndterer nå tab-key og tabindex riktig
KenAJoh Jan 14, 2024
c5bb7ed
:memo: Changeset
KenAJoh Jan 15, 2024
aefeb99
:memo: Changeset
KenAJoh Jan 15, 2024
6f62cb5
[V6] Deprecated Grid og ContentContainer (#2622)
KenAJoh Jan 15, 2024
d179824
Merge branch 'main' into aksel-v6
KenAJoh Jan 15, 2024
c0419ad
Merge branch 'main' into aksel-v6
KenAJoh Jan 16, 2024
444fe5d
Textarea: Fjern wrapper (#2635)
HalvorHaugan Jan 16, 2024
5706b06
Merge branch 'main' into aksel-v6
KenAJoh Jan 16, 2024
af14279
[V6] Chat-props deprecation (#2631)
KenAJoh Jan 18, 2024
c59a808
[V6] 1440px breakpoint (#2632)
KenAJoh Jan 18, 2024
9512fc6
[V6] Fjernet z-index-modal token (#2637)
KenAJoh Jan 18, 2024
40f688f
Merge branch 'main' into aksel-v6
KenAJoh Jan 18, 2024
aa8cc46
[V6] ErrorSummary magic (#2642)
KenAJoh Jan 18, 2024
fc3d520
:memo: Oppdatert migreringsguide for z-index + tailwind
KenAJoh Jan 18, 2024
32523e4
:bug: Fikset bruk av z-modal i tailwind
KenAJoh Jan 18, 2024
c2e1e94
Merge branch 'main' into aksel-v6
KenAJoh Jan 29, 2024
5891e69
Merge branch 'main' into aksel-v6
KenAJoh Jan 31, 2024
44e4ce1
Merge branch 'main' into aksel-v6
KenAJoh Jan 31, 2024
7637388
:fire: Fjernet descendants-filer
KenAJoh Jan 31, 2024
0f35d9b
:twisted_rightwards_arrows: merge aksel-v6
KenAJoh Jan 31, 2024
6a7383d
:memo: Rename context og types til namespace
KenAJoh Jan 31, 2024
d4ae3ea
Merge branch 'main' into aksel-v6
KenAJoh Feb 6, 2024
857b14e
Merge branch 'main' into aksel-v6
KenAJoh Feb 6, 2024
caa34f1
Merge branch 'main' into aksel-v6
KenAJoh Feb 7, 2024
832c406
:fire: Fjernet openOnFocus-prop fra date
KenAJoh Feb 7, 2024
83df87a
[V6] Modal: strengere prop-typer (#2718)
HalvorHaugan Feb 8, 2024
a6bd0f8
Merge branch 'main' into aksel-v6
KenAJoh Feb 13, 2024
4999e28
:art: SortState i Table har nå none tilgjengelig (#2726)
KenAJoh Feb 14, 2024
939e6ad
[V6] Oppdatert bruk av action-farger (#2717)
KenAJoh Feb 14, 2024
3f6b930
[V6] Native ESM-støtte 🎉 (#2677)
KenAJoh Feb 14, 2024
f0a3598
Merge branch 'main' into aksel-v6
KenAJoh Feb 14, 2024
d10a361
Merge branch 'aksel-v6' into new-internal-tabs
KenAJoh Feb 14, 2024
13cca43
:truck: rename fitted -> fill in tabs
KenAJoh Feb 14, 2024
63e4467
:bug: Async-lasting av date-fns er nå v3 esm compliant
KenAJoh Feb 14, 2024
143c2fd
Merge branch 'main' into aksel-v6
KenAJoh Feb 14, 2024
07b9897
Merge branch 'aksel-v6' into new-internal-tabs
KenAJoh Feb 14, 2024
e3195ff
:test_tube: Forbedret Tabs-tester
KenAJoh Feb 14, 2024
2a9c578
Merge branch 'main' into new-internal-tabs
KenAJoh Feb 19, 2024
40a59df
:arrow_up: yarn sync
KenAJoh Feb 19, 2024
64d53a0
Merge branch 'main' into new-internal-tabs
KenAJoh Mar 4, 2024
5f0980a
:arrow_up: Yarn lock
KenAJoh Mar 4, 2024
3846179
:arrow_down: Reversert duplikate endringer som kom fra v6
KenAJoh Mar 5, 2024
400f6b8
Merge branch 'main' into new-internal-tabs
KenAJoh Mar 18, 2024
6fc0b04
Merge branch 'main' into new-internal-tabs
KenAJoh Mar 19, 2024
81031e0
:art: Aria-hidden blir nå satt på ikon hvis label allerede er satt på…
KenAJoh Mar 19, 2024
f44b64b
Merge branch 'main' into new-internal-tabs
KenAJoh Mar 19, 2024
dc6a753
Update @navikt/core/react/src/tabs/Tabs.types.ts
KenAJoh Apr 9, 2024
9e67fe0
Merge branch 'main' into new-internal-tabs
KenAJoh Apr 10, 2024
9956527
:memo: Testnavn for tabs
KenAJoh Apr 10, 2024
2099db6
:zap: Skipper unødvendig memo for tab-context, punktum etter all jsdoc
KenAJoh Apr 10, 2024
578cd94
:fire: Fjernet TabsContextProps
KenAJoh Apr 10, 2024
b6321da
:memo: Fjernet comma på changeset
KenAJoh Apr 10, 2024
58ec574
:memo: Fill-demo for aksel.nav.no
KenAJoh Apr 10, 2024
57dcccb
:memo: Changeset for lazy-prop
KenAJoh Apr 10, 2024
39d5403
Update @navikt/core/react/src/tabs/parts/tabpanel/TabPanel.tsx
KenAJoh Apr 10, 2024
1a4b1da
:bug: Beholder attr fra radix med i ny implementasjon
KenAJoh Apr 10, 2024
2fdb803
:zap: Flyttet fokus-state update ut av useeffect, fjernet unødvendig …
KenAJoh Apr 10, 2024
b9ba91b
:zap: Unngår unødvendig sjekk for disabled i onFocus for useTab2
KenAJoh Apr 10, 2024
9a5cd3f
:recycle: tab og tabpanel støtter nå egne id-er
KenAJoh Apr 10, 2024
5e4a996
Update @navikt/core/react/src/tabs/useTabs.ts
KenAJoh Apr 10, 2024
8027679
:bug: I none tilfeller førte setFocusedValue utenfor useEffect til in…
KenAJoh Apr 10, 2024
b97d548
Update @navikt/core/react/src/tabs/parts/tab/Tab.tsx
KenAJoh Apr 10, 2024
300e201
:bug: bruker-id var satt på feil attrb
KenAJoh Apr 10, 2024
5ac2767
:memo: Dokumentert custom-ids for tabs
KenAJoh Apr 10, 2024
91af155
:zap: Chroamtic-format for tabs-stories
KenAJoh Apr 10, 2024
fbd4894
:recycle: Omskrevet tabs-stories for ny syntax
KenAJoh Apr 10, 2024
808af36
:memo: Bruker bold markdown istedenfor note syntax
KenAJoh Apr 10, 2024
f4f2478
:memo: Flyttet warning til newline
KenAJoh Apr 10, 2024
86493b1
:memo: Bruker bare ett linjeskift for jsdoc
KenAJoh Apr 10, 2024
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
5 changes: 5 additions & 0 deletions .changeset/pink-cobras-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-react": minor
---

Tabs: Ny prop `lazy` som rendrer innhold i TabPanel selv når panel er skjult (har fortsatt display:none)
5 changes: 5 additions & 0 deletions .changeset/rotten-planets-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-react": minor
---

Tabs: La til ny prop `fill` som lar Tabs.Tab-elementer strekke seg over tilgjengelig bredde.
5 changes: 5 additions & 0 deletions .changeset/silver-peas-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-react": minor
---

Tabs: Erstattet bruk av dependency `@radix-ui/react-tabs` med egen implementasjon.
10 changes: 9 additions & 1 deletion @navikt/core/css/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.navds-tabs__tablist {
display: flex;
max-width: 100%;
width: auto;
width: 100%;
scroll-behavior: smooth;
-ms-overflow-style: none; /* for Internet Explorer, Edge */
scrollbar-width: none; /* for Firefox */
Expand Down Expand Up @@ -83,6 +83,10 @@
gap: var(--a-spacing-1);
}

.navds-tabs__tab-inner > * {
display: inline-flex;
}

.navds-tabs__tab-inner svg {
flex-shrink: 0;
}
Expand Down Expand Up @@ -117,6 +121,10 @@
font-size: 1.5rem;
}

.navds-tabs__tab--fill {
flex: 1 1 100%;
}

.navds-tabs__tabpanel:focus-visible {
outline: 2px solid transparent;
box-shadow: inset 0 0 0 2px var(--a-border-focus);
Expand Down
1 change: 0 additions & 1 deletion @navikt/core/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,6 @@
"@floating-ui/react": "0.25.4",
"@navikt/aksel-icons": "^6.4.1",
"@navikt/ds-tokens": "^6.4.1",
"@radix-ui/react-tabs": "1.0.0",
"@radix-ui/react-toggle-group": "1.0.0",
"clsx": "^2.1.0",
"date-fns": "^3.0.0",
Expand Down
66 changes: 0 additions & 66 deletions @navikt/core/react/src/tabs/Tab.tsx

This file was deleted.

128 changes: 0 additions & 128 deletions @navikt/core/react/src/tabs/TabList.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions @navikt/core/react/src/tabs/TabPanel.tsx

This file was deleted.

24 changes: 24 additions & 0 deletions @navikt/core/react/src/tabs/Tabs.context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { createContext } from "../util/create-context";
import { createDescendantContext } from "../util/hooks/descendants/useDescendant";
import { TabsProps } from "./Tabs.types";
import { useTabs } from "./useTabs";

export const [
TabsDescendantsProvider,
useTabsDescendantsContext,
useTabsDescendants,
useTabsDescendant,
] = createDescendantContext<HTMLButtonElement, { value: string }>();

type TabsProviderProps = ReturnType<typeof useTabs> &
Pick<
TabsProps,
"selectionFollowsFocus" | "loop" | "size" | "iconPosition" | "fill"
>;

/* State context */
export const [TabsProvider, useTabsContext] = createContext<TabsProviderProps>({
name: "TabsContext",
hookName: "useTabsContext",
providerName: "TabsProvider",
});
Loading
Loading