@oslokommune/punkt-react 12.2.0 → 12.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +1 -1
- package/dist/index.d.ts +68 -0
- package/dist/punkt-react.es.js +10609 -6256
- package/dist/punkt-react.umd.js +549 -87
- package/package.json +7 -3
- package/src/components/accordion/Accordion.tsx +2 -0
- package/src/components/accordion/AccordionItem.tsx +2 -0
- package/src/components/alert/Alert.tsx +2 -0
- package/src/components/backlink/BackLink.tsx +2 -0
- package/src/components/breadcrumbs/Breadcrumbs.tsx +2 -0
- package/src/components/button/Button.tsx +2 -0
- package/src/components/card/Card.tsx +37 -0
- package/src/components/checkbox/Checkbox.tsx +2 -0
- package/src/components/childrenWrapper/childrenWrapper.tsx +20 -0
- package/src/components/datepicker/Datepicker.tsx +52 -0
- package/src/components/footer/Footer.tsx +2 -0
- package/src/components/footerSimple/FooterSimple.tsx +2 -1
- package/src/components/header/Header.tsx +10 -4
- package/src/components/icon/IconContext.tsx +2 -0
- package/src/components/index.ts +3 -0
- package/src/components/input/Input.tsx +2 -0
- package/src/components/inputwrapper/InputWrapper.tsx +2 -0
- package/src/components/link/Link.tsx +37 -0
- package/src/components/linkcard/LinkCard.tsx +2 -0
- package/src/components/preview/Preview.tsx +50 -10
- package/src/components/preview/PreviewSpecs.tsx +15 -3
- package/src/components/progressbar/Progressbar.tsx +2 -0
- package/src/components/radio/RadioButton.tsx +2 -0
- package/src/components/searchinput/SearchInput.tsx +2 -0
- package/src/components/select/Select.tsx +2 -0
- package/src/components/stepper/Step.tsx +2 -0
- package/src/components/stepper/Stepper.tsx +2 -0
- package/src/components/table/Table.tsx +2 -0
- package/src/components/table/TableBody.tsx +2 -0
- package/src/components/table/TableData.tsx +2 -0
- package/src/components/table/TableDataCell.tsx +2 -0
- package/src/components/table/TableHeader.tsx +2 -0
- package/src/components/table/TableHeaderCell.tsx +2 -0
- package/src/components/table/TableRow.tsx +2 -0
- package/src/components/tag/Tag.tsx +80 -92
- package/src/components/textarea/Textarea.tsx +2 -0
- package/src/components/textinput/Textinput.tsx +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,30 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [12.3.0](https://github.com/oslokommune/punkt/compare/12.2.0...12.3.0) (2024-10-03)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
* Eksperimentell release av Punkt Elements. EKSPERIMENTELL! (#1940). * feat(all): Eksperimentell release av Punkt Elements. EKSPERIMENTELL!
|
|
15
|
+
|
|
16
|
+
* feat(all): Eksperimentell release av Punkt Elements. EKSPERIMENTELL!
|
|
17
|
+
|
|
18
|
+
Tvinger bygg
|
|
19
|
+
* Eksperimentell release av Punkt Elements. EKSPERIMENTELL! (#1939).
|
|
20
|
+
* Eksperimentell release for Punkt Elements. EKSPERIMENTELL!. Denne release bør kun brukes til testing av nye custom elements (web components) og skal helst ikke brukes i produksjon. Når vi er *ferdig testet* vil ny release bli neste major-release.
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
Ingen
|
|
25
|
+
|
|
26
|
+
### Chores
|
|
27
|
+
Ingen
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
|
|
8
32
|
## [12.2.0](https://github.com/oslokommune/punkt/compare/12.1.0...12.2.0) (2024-09-30)
|
|
9
33
|
|
|
10
34
|
### ⚠ BREAKING CHANGES
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<a href="https://www.npmjs.com/package/@oslokommune/punkt-react" target="_blank"><img src="https://img.shields.io/npm/v/@oslokommune/punkt-react?logo=react&label=react&style=for-the-badge&color=61dafb" alt="React komponenter" /></a>
|
|
4
4
|
|
|
5
|
-
Dette repoet inneholder Punkt sine UI-komponenter for React. Komponentene er laget for å fungere sammen med `@oslokommune/punkt-assets` og `@oslokommune/punkt-css`.
|
|
5
|
+
Dette repoet inneholder Punkt sine UI-komponenter for React. Komponentene er laget for å fungere sammen med `@oslokommune/punkt-assets` og `@oslokommune/punkt-css`. Enkelte komponenter tar i bruk custom elements fra `@oslokommune/punkt-elements`. Enn så lenge støtter vi ikke full bruk i server-side-genererte apper.
|
|
6
6
|
|
|
7
7
|
## 📝 Forutsetninger
|
|
8
8
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { Context } from 'react';
|
|
4
4
|
import { default as default_2 } from 'react';
|
|
5
|
+
import { FC } from 'react';
|
|
5
6
|
import { ForwardRefExoticComponent } from 'react';
|
|
6
7
|
import { HTMLAttributes } from 'react';
|
|
7
8
|
import { HTMLProps } from 'react';
|
|
8
9
|
import { InputHTMLAttributes } from 'react';
|
|
9
10
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
11
|
+
import { PktElType } from '../../interfaces/IPktElements';
|
|
10
12
|
import * as React_2 from 'react';
|
|
11
13
|
import { ReactElement } from 'react';
|
|
12
14
|
import { ReactNode } from 'react';
|
|
@@ -104,6 +106,21 @@ declare interface IPktButton extends default_2.ButtonHTMLAttributes<HTMLButtonEl
|
|
|
104
106
|
onClick?: (event: default_2.MouseEvent<HTMLButtonElement>) => void;
|
|
105
107
|
}
|
|
106
108
|
|
|
109
|
+
declare interface IPktCard extends PktElType {
|
|
110
|
+
direction?: 'portrait' | 'landscape';
|
|
111
|
+
skin?: 'outlined' | 'gray' | 'beige' | 'green' | 'blue';
|
|
112
|
+
heading?: string;
|
|
113
|
+
subheading?: string;
|
|
114
|
+
tags?: (Omit<IPktTag, 'closeTag'> & {
|
|
115
|
+
text: string;
|
|
116
|
+
})[];
|
|
117
|
+
image?: {
|
|
118
|
+
src: string;
|
|
119
|
+
alt: string;
|
|
120
|
+
};
|
|
121
|
+
children?: ReactNode | ReactNode[];
|
|
122
|
+
}
|
|
123
|
+
|
|
107
124
|
declare interface IPktCheckbox extends default_2.InputHTMLAttributes<HTMLInputElement> {
|
|
108
125
|
id: string;
|
|
109
126
|
hasTile?: boolean;
|
|
@@ -118,6 +135,40 @@ declare interface IPktCheckbox extends default_2.InputHTMLAttributes<HTMLInputEl
|
|
|
118
135
|
value?: string;
|
|
119
136
|
}
|
|
120
137
|
|
|
138
|
+
declare interface IPktDatepicker extends PktElType {
|
|
139
|
+
value?: string | string[];
|
|
140
|
+
label?: string;
|
|
141
|
+
id?: string;
|
|
142
|
+
dateformat?: string;
|
|
143
|
+
multiple?: boolean;
|
|
144
|
+
maxlength?: number;
|
|
145
|
+
disabled?: boolean;
|
|
146
|
+
range?: boolean;
|
|
147
|
+
weeknumbers?: boolean;
|
|
148
|
+
withcontrols?: boolean;
|
|
149
|
+
fullWidth?: boolean;
|
|
150
|
+
min?: string | number | undefined;
|
|
151
|
+
max?: string | number | undefined;
|
|
152
|
+
excludedates?: string[];
|
|
153
|
+
excludeweekdays?: string[];
|
|
154
|
+
currentmonth?: string;
|
|
155
|
+
calendarOpen?: boolean;
|
|
156
|
+
required?: boolean;
|
|
157
|
+
requiredTag?: boolean;
|
|
158
|
+
requiredText?: string;
|
|
159
|
+
optionalTag?: boolean;
|
|
160
|
+
optionalText?: string;
|
|
161
|
+
helptext?: string;
|
|
162
|
+
helptextDropdown?: string;
|
|
163
|
+
helptextDropdownButton?: string;
|
|
164
|
+
hasError?: boolean;
|
|
165
|
+
errorMessage?: string;
|
|
166
|
+
strings?: any;
|
|
167
|
+
onChange?: (e: Event) => void;
|
|
168
|
+
onValueChange?: (e: CustomEvent) => void;
|
|
169
|
+
onToggleHelpText?: (e: CustomEvent) => void;
|
|
170
|
+
}
|
|
171
|
+
|
|
121
172
|
declare interface IPktFooter extends default_2.HTMLAttributes<HTMLDivElement> {
|
|
122
173
|
columnOne: Column;
|
|
123
174
|
columnTwo: Column;
|
|
@@ -180,6 +231,15 @@ declare interface IPktInputWrapper extends RefAttributes<HTMLElement> {
|
|
|
180
231
|
hasFieldset?: boolean;
|
|
181
232
|
}
|
|
182
233
|
|
|
234
|
+
declare interface IPktLink extends PktElType {
|
|
235
|
+
href?: string;
|
|
236
|
+
iconName?: string | undefined;
|
|
237
|
+
iconPosition?: string | undefined;
|
|
238
|
+
external?: boolean;
|
|
239
|
+
onClick?: (e: CustomEvent) => void;
|
|
240
|
+
children?: default_2.ReactNode | default_2.ReactNode[];
|
|
241
|
+
}
|
|
242
|
+
|
|
183
243
|
declare interface IPktLinkCard extends default_2.HTMLAttributes<HTMLAnchorElement> {
|
|
184
244
|
skin?: 'normal' | 'blue' | 'beige' | 'beige-outline' | 'green' | 'grey' | 'gray' | 'grey-outline' | 'gray-outline';
|
|
185
245
|
title?: string;
|
|
@@ -410,6 +470,7 @@ declare interface ISpecObject {
|
|
|
410
470
|
name?: string;
|
|
411
471
|
'css-class'?: string;
|
|
412
472
|
'dark-mode'?: boolean;
|
|
473
|
+
isElement?: boolean;
|
|
413
474
|
props?: Record<string, PropObject | string[]>;
|
|
414
475
|
events?: Record<string, PropObject>;
|
|
415
476
|
slots?: Record<string, any>;
|
|
@@ -475,8 +536,12 @@ export declare const PktBreadcrumbs: default_2.ForwardRefExoticComponent<IPktBre
|
|
|
475
536
|
|
|
476
537
|
export declare const PktButton: default_2.ForwardRefExoticComponent<IPktButton & default_2.RefAttributes<HTMLButtonElement>>;
|
|
477
538
|
|
|
539
|
+
export declare const PktCard: FC<IPktCard>;
|
|
540
|
+
|
|
478
541
|
export declare const PktCheckbox: default_2.ForwardRefExoticComponent<IPktCheckbox & default_2.RefAttributes<HTMLInputElement>>;
|
|
479
542
|
|
|
543
|
+
export declare const PktDatepicker: FC<IPktDatepicker>;
|
|
544
|
+
|
|
480
545
|
export declare const PktFooter: default_2.FC<IPktFooter>;
|
|
481
546
|
|
|
482
547
|
export declare const PktFooterSimple: default_2.FC<IPktFooterSimple>;
|
|
@@ -508,6 +573,8 @@ export declare const PktInput: default_2.ForwardRefExoticComponent<InputProps &
|
|
|
508
573
|
|
|
509
574
|
export declare const PktInputWrapper: default_2.ForwardRefExoticComponent<Omit<IPktInputWrapper, "ref"> & default_2.RefAttributes<HTMLDivElement>>;
|
|
510
575
|
|
|
576
|
+
export declare const PktLink: FC<IPktLink>;
|
|
577
|
+
|
|
511
578
|
export declare const PktLinkCard: default_2.ForwardRefExoticComponent<IPktLinkCard & default_2.RefAttributes<HTMLAnchorElement>>;
|
|
512
579
|
|
|
513
580
|
export declare const PktLoader: default_2.ForwardRefExoticComponent<IPktLoader & default_2.RefAttributes<HTMLDivElement>>;
|
|
@@ -558,6 +625,7 @@ declare type PropObject = {
|
|
|
558
625
|
name?: string;
|
|
559
626
|
description?: string;
|
|
560
627
|
type?: string | string[];
|
|
628
|
+
variant?: string;
|
|
561
629
|
converter?: string;
|
|
562
630
|
reflect?: boolean;
|
|
563
631
|
default?: any;
|