@easygov/react-components 0.0.2 → 0.2.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.
@@ -7,15 +7,28 @@ import { Combobox } from '@base-ui/react/combobox';
7
7
  import * as React$1 from 'react';
8
8
  import React__default, { SVGProps } from 'react';
9
9
  import { Input as Input$1 } from '@base-ui/react/input';
10
+ import { NavigationMenu as NavigationMenu$1 } from '@base-ui/react/navigation-menu';
11
+ import { Select as Select$1 } from '@base-ui/react/select';
10
12
  export { Account, Add, AddAlt, AddComment, AddFilled, Alarm, AlarmAdd, AlarmSubtract, ArrowDown, ArrowDownLeft, ArrowDownRight, ArrowLeft, ArrowRight, ArrowUp, ArrowUpLeft, ArrowUpRight, Asleep, AsleepFilled, Attachment, Bookmark, BookmarkFilled, Box, Bullhorn, Calculation, CalculationAlt, Calculator, Calendar, CalendarAdd, CalendarAddAlt, Camera, CaretDown, CaretLeft, CaretRight, CaretSort, CaretSortDown, CaretSortUp, CaretUp, CharacterPatterns, Chat, ChatLaunch, Checkbox, CheckboxChecked, CheckboxCheckedFilled, CheckboxIndeterminate, CheckboxIndeterminateFilled, CheckboxUndeterminate, CheckboxUndeterminateFilled, Checkmark, CheckmarkFilled, CheckmarkOutline, CheckmarkOutlineWarning, ChevronDown, ChevronLeft, ChevronRight, ChevronSort, ChevronSortDown, ChevronSortUp, ChevronUp, Close, CloseFilled, CloseOutline, ClosedCaptionAlt, Copy, CopyFile, CopyLink, Data, Delete, Document, DocumentAdd, DocumentAttachment, DocumentBlank, DocumentDownload, DocumentEdit, DocumentExport, DocumentImport, DocumentPdf, DocumentSettings, DocumentSubtract, DocumentTasks, Download, Draggable, EarthEuropeAfricaFilled, Edit, Email, EmailNew, Enterprise, Error, ErrorFilled, ErrorOutline, Events, Filter, Finance, Flag, FlagFilled, Folder, FolderAdd, FolderMoveTo, Folders, Forum, Globe, GlobeAlt, Group, Help, HelpFilled, Home, IconBase, IconProps, IdManagement, Idea, Identification, Industry, Information, InformationFilled, InformationSquare, InformationSquareFilled, Launch, Light, LightFilled, Link, List, ListBoxes, ListBulleted, ListChecked, Location, Locked, Login, LogoFacebook, LogoInstagram, LogoLinkedin, LogoTwitter, LogoXing, LogoYoutube, Logout, ManageProtection, Menu, MessageQueue, Meter, MeterAlt, Misuse, MisuseOutline, Notification, NotificationFilled, NotificationNew, OverflowMenuHorizontal, OverflowMenuVertical, Password, PedestrianFamily, Pen, Pending, PendingFilled, Person, Phone, PhoneFilled, PhoneIp, Pin, Policy, PreviousFilled, PreviousOutline, Printer, RadioButton, RadioButtonChecked, Reminder, Renew, Reset, Restart, Restaurant, ResultNew, Review, Rocket, Rotate360, RuleFilled, Save, Search, SearchLocate, Security, Send, SendAlt, Settings, SettingsAdjust, Star, StarFilled, Subtract, SubtractFilled, Task, TaskSettings, TaskStar, Time, Timer, Unlocked, Upload, User, UserAdd, UserAvatar, UserAvatarFilled, UserAvatarFilledAlt, UserMultiple, UserProfile, UserSettings, View, ViewAltOff, ViewFilled, ViewOff, ViewOffFilled, Warning, WarningAlt, WarningAltFilled, WarningFilled, WorkflowAutomation, iconVariants } from './icons.mjs';
11
13
 
12
14
  declare const buttonVariants: (props?: ({
13
15
  variant?: "primary" | "secondary" | "critical" | "tertiary" | null | undefined;
14
- size?: "s" | "m" | "l" | null | undefined;
16
+ size?: "s" | "m" | "l" | "icon-s" | "icon-m" | "icon-l" | null | undefined;
15
17
  } & class_variance_authority_types.ClassProp) | undefined) => string;
16
- interface ButtonProps extends Omit<Button$1.Props, "className">, VariantProps<typeof buttonVariants> {
18
+ type IconSize = "icon-s" | "icon-m" | "icon-l";
19
+ type StandardSize = "s" | "m" | "l";
20
+ type ButtonVariant = NonNullable<VariantProps<typeof buttonVariants>["variant"]>;
21
+ type ButtonBase = Omit<Button$1.Props, "className"> & {
17
22
  className?: string;
18
- }
23
+ variant?: ButtonVariant;
24
+ };
25
+ type ButtonProps = (ButtonBase & {
26
+ size: IconSize;
27
+ "aria-label": string;
28
+ }) | (ButtonBase & {
29
+ size?: StandardSize;
30
+ "aria-label"?: string;
31
+ });
19
32
  declare function Button({ className, variant, size, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
20
33
 
21
34
  declare function Dropdown({ multiple, ...props }: React$1.ComponentProps<typeof Combobox.Root>): react_jsx_runtime.JSX.Element;
@@ -76,6 +89,40 @@ declare function DropdownEmpty({ className, ...props }: Combobox.Empty.Props): r
76
89
  declare function DropdownSeparator({ className, ...props }: Combobox.Separator.Props): react_jsx_runtime.JSX.Element;
77
90
  declare function DropdownCollection(props: Combobox.Collection.Props): react_jsx_runtime.JSX.Element;
78
91
 
92
+ /**
93
+ * Maps to the Figma "Footer (Desktop)" frame. Fully self-contained — like
94
+ * `EasygovHeader` — so consumers just render `<EasygovFooter />`. All link
95
+ * columns, the legal row, social links, and the government partner logos
96
+ * (Confederation, KdK, Städteverband, Gemeindeverband) and Swiss shield are
97
+ * official/fixed content, not per-page configuration, so nothing is exposed
98
+ * as props.
99
+ *
100
+ * All `href="#"` values below are placeholders — real destination URLs
101
+ * aren't decided yet.
102
+ */
103
+ declare function EasygovFooter(): React__default.JSX.Element;
104
+
105
+ type MobileSpan = 1 | 2 | 3 | 4;
106
+ type TabletSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
107
+ type DesktopSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
108
+ type GridProps = React$1.HTMLAttributes<HTMLDivElement>;
109
+ /**
110
+ * Responsive CSS Grid container: 4 columns (mobile), 8 (tablet), 12 (desktop).
111
+ * Rows are automatic — place `GridItem`s directly inside, no row wrapper needed.
112
+ */
113
+ declare function Grid({ className, children, ...props }: GridProps): react_jsx_runtime.JSX.Element;
114
+ interface GridItemProps extends React$1.HTMLAttributes<HTMLDivElement> {
115
+ span?: MobileSpan;
116
+ spanTablet?: TabletSpan;
117
+ spanDesktop?: DesktopSpan;
118
+ }
119
+ /**
120
+ * Defaults to full width (4/8/12) at every breakpoint if a span isn't given,
121
+ * matching the classes a non-React consumer would apply by hand
122
+ * (`eg-grid__item--span-4 eg-grid__item--span-tablet-8 eg-grid__item--span-desktop-12`).
123
+ */
124
+ declare function GridItem({ span, spanTablet, spanDesktop, className, children, ...props }: GridItemProps): react_jsx_runtime.JSX.Element;
125
+
79
126
  declare const inputFieldVariants: (props?: ({
80
127
  size?: "s" | "m" | "l" | null | undefined;
81
128
  } & class_variance_authority_types.ClassProp) | undefined) => string;
@@ -99,6 +146,81 @@ interface TextLinkProps extends Omit<React__default.AnchorHTMLAttributes<HTMLAnc
99
146
  }
100
147
  declare function TextLink({ className, variant, size, disabled, children, onClick, tabIndex, ...props }: TextLinkProps): react_jsx_runtime.JSX.Element;
101
148
 
149
+ interface NavigationMenuProps extends NavigationMenu$1.Root.Props {
150
+ className?: string;
151
+ positionerProps?: Partial<NavigationMenu$1.Positioner.Props>;
152
+ container?: HTMLElement | ShadowRoot | null;
153
+ }
154
+ declare function NavigationMenu({ className, children, positionerProps, container, ...props }: NavigationMenuProps): react_jsx_runtime.JSX.Element;
155
+ interface NavigationMenuListProps extends NavigationMenu$1.List.Props {
156
+ className?: string;
157
+ }
158
+ declare function NavigationMenuList({ className, ...props }: NavigationMenuListProps): react_jsx_runtime.JSX.Element;
159
+ interface NavigationMenuItemProps extends NavigationMenu$1.Item.Props {
160
+ className?: string;
161
+ }
162
+ declare function NavigationMenuItem({ className, ...props }: NavigationMenuItemProps): react_jsx_runtime.JSX.Element;
163
+ interface NavigationMenuTriggerProps extends Omit<NavigationMenu$1.Trigger.Props, "className"> {
164
+ className?: string;
165
+ leadingIcon?: React$1.ReactNode;
166
+ badge?: number | string;
167
+ }
168
+ declare function NavigationMenuTrigger({ className, leadingIcon, badge, disabled, children, ...props }: NavigationMenuTriggerProps): react_jsx_runtime.JSX.Element;
169
+ interface NavigationMenuAnchorProps extends Omit<NavigationMenu$1.Link.Props, "className"> {
170
+ className?: string;
171
+ leadingIcon?: React$1.ReactNode;
172
+ }
173
+ declare function NavigationMenuAnchor({ className, leadingIcon, children, ...props }: NavigationMenuAnchorProps): react_jsx_runtime.JSX.Element;
174
+ interface NavigationMenuContentProps extends NavigationMenu$1.Content.Props {
175
+ className?: string;
176
+ }
177
+ declare function NavigationMenuContent({ className, ...props }: NavigationMenuContentProps): react_jsx_runtime.JSX.Element;
178
+ interface NavigationMenuLinkProps extends Omit<NavigationMenu$1.Link.Props, "className"> {
179
+ className?: string;
180
+ leadingIcon?: React$1.ReactNode;
181
+ trailingIcon?: React$1.ReactNode;
182
+ active?: boolean;
183
+ }
184
+ declare function NavigationMenuLink({ className, leadingIcon, trailingIcon, active, children, ...props }: NavigationMenuLinkProps): react_jsx_runtime.JSX.Element;
185
+
186
+ declare function Select<Value = unknown, Multiple extends boolean | undefined = false>(props: Select$1.Root.Props<Value, Multiple>): React$1.JSX.Element;
187
+ interface SelectLabelProps extends Omit<React$1.LabelHTMLAttributes<HTMLLabelElement>, "className"> {
188
+ className?: string;
189
+ disabled?: boolean;
190
+ }
191
+ declare function SelectLabel({ className, disabled, ...props }: SelectLabelProps): react_jsx_runtime.JSX.Element;
192
+ interface SelectHelperTextProps extends Omit<React$1.HTMLAttributes<HTMLSpanElement>, "className"> {
193
+ className?: string;
194
+ }
195
+ declare function SelectHelperText({ className, ...props }: SelectHelperTextProps): react_jsx_runtime.JSX.Element;
196
+ interface SelectTriggerProps extends Omit<Select$1.Trigger.Props, "className"> {
197
+ className?: string;
198
+ placeholder?: string;
199
+ leadingIcon?: React$1.ReactNode;
200
+ }
201
+ declare function SelectTrigger({ className, placeholder, leadingIcon, ...props }: SelectTriggerProps): react_jsx_runtime.JSX.Element;
202
+ interface SelectContentProps extends Select$1.Popup.Props {
203
+ sideOffset?: number;
204
+ alignItemWithTrigger?: boolean;
205
+ className?: string;
206
+ container?: HTMLElement | ShadowRoot | null;
207
+ }
208
+ declare function SelectContent({ className, children, sideOffset, alignItemWithTrigger, container, ...props }: SelectContentProps): react_jsx_runtime.JSX.Element;
209
+ interface SelectItemProps extends Omit<Select$1.Item.Props, "className"> {
210
+ className?: string;
211
+ leadingIcon?: React$1.ReactNode;
212
+ }
213
+ declare function SelectItem({ className, children, leadingIcon, ...props }: SelectItemProps): react_jsx_runtime.JSX.Element;
214
+ declare function SelectGroup(props: Select$1.Group.Props): react_jsx_runtime.JSX.Element;
215
+ interface SelectGroupLabelProps extends Omit<Select$1.GroupLabel.Props, "className"> {
216
+ className?: string;
217
+ }
218
+ declare function SelectGroupLabel({ className, ...props }: SelectGroupLabelProps): react_jsx_runtime.JSX.Element;
219
+ interface SelectSeparatorProps extends Omit<Select$1.Separator.Props, "className"> {
220
+ className?: string;
221
+ }
222
+ declare function SelectSeparator({ className, ...props }: SelectSeparatorProps): react_jsx_runtime.JSX.Element;
223
+
102
224
  interface BrandProps extends Omit<SVGProps<SVGSVGElement>, "width" | "height"> {
103
225
  /**
104
226
  * Height in pixels. Width scales automatically from the viewBox aspect ratio.
@@ -137,4 +259,67 @@ declare function BrandXing(props: BrandProps): react_jsx_runtime.JSX.Element;
137
259
 
138
260
  declare function BrandYoutube(props: BrandProps): react_jsx_runtime.JSX.Element;
139
261
 
140
- export { BrandBase, BrandEasygov, BrandFacebook, BrandKdk, BrandLinkedin, type BrandProps, BrandSeg, BrandSgv, BrandSsv, BrandSwiss, BrandXing, BrandYoutube, Button, type ButtonProps, Dropdown, DropdownChip, DropdownChipsOverflow, type DropdownChipsOverflowProps, DropdownChipsTrigger, type DropdownChipsTriggerProps, DropdownCollection, DropdownEmpty, DropdownGroup, DropdownGroupLabel, DropdownHelperText, type DropdownHelperTextProps, DropdownInput, DropdownItem, type DropdownItemProps, DropdownItemText, DropdownLabel, type DropdownLabelProps, DropdownList, DropdownPopup, type DropdownPopupProps, DropdownSeparator, DropdownToggle, DropdownTrigger, type DropdownTriggerProps, DropdownValue, Input, type InputProps, TextLink, type TextLinkProps, buttonVariants, textLinkVariants };
262
+ interface SessionUser {
263
+ sub: string;
264
+ name: string;
265
+ }
266
+
267
+ declare const dictionaries: {
268
+ de: {
269
+ readonly login: "Anmelden";
270
+ readonly logout: "Abmelden";
271
+ readonly dashboard: "Dashboard";
272
+ readonly selectLanguage: "Sprache wählen";
273
+ readonly loginSuccess: "Sie sind jetzt angemeldet.";
274
+ readonly logoutSuccess: "Sie wurden abgemeldet.";
275
+ readonly skipToMain: "Zum Hauptinhalt springen";
276
+ };
277
+ en: {
278
+ readonly login: "Sign In";
279
+ readonly logout: "Sign Out";
280
+ readonly dashboard: "Dashboard";
281
+ readonly selectLanguage: "Select language";
282
+ readonly loginSuccess: "You are now signed in.";
283
+ readonly logoutSuccess: "You have been signed out.";
284
+ readonly skipToMain: "Skip to main content";
285
+ };
286
+ fr: {
287
+ readonly login: "Se connecter";
288
+ readonly logout: "Se déconnecter";
289
+ readonly dashboard: "Tableau de bord";
290
+ readonly selectLanguage: "Choisir la langue";
291
+ readonly loginSuccess: "Vous êtes maintenant connecté.";
292
+ readonly logoutSuccess: "Vous avez été déconnecté.";
293
+ readonly skipToMain: "Aller au contenu principal";
294
+ };
295
+ it: {
296
+ readonly login: "Accedi";
297
+ readonly logout: "Esci";
298
+ readonly dashboard: "Dashboard";
299
+ readonly selectLanguage: "Seleziona la lingua";
300
+ readonly loginSuccess: "Hai effettuato l'accesso.";
301
+ readonly logoutSuccess: "Hai effettuato il logout.";
302
+ readonly skipToMain: "Vai al contenuto principale";
303
+ };
304
+ };
305
+ type Locale = keyof typeof dictionaries;
306
+
307
+ interface EasygovSession {
308
+ user: SessionUser | null;
309
+ accessToken: string | null;
310
+ }
311
+ declare function useEasygovSession(): EasygovSession;
312
+ interface EasygovHeaderProps {
313
+ readonly locale?: Locale;
314
+ readonly onLanguageChange?: (locale: Locale) => void;
315
+ readonly onNavigate?: (path: string) => void;
316
+ }
317
+ declare function EasygovHeader({ locale: localeProp, onLanguageChange, onNavigate, }: EasygovHeaderProps): React__default.JSX.Element;
318
+ interface RequireSessionProps {
319
+ readonly children: React__default.ReactNode;
320
+ readonly fallback?: React__default.ReactNode;
321
+ readonly loading?: React__default.ReactNode;
322
+ }
323
+ declare function RequireSession({ children, fallback, loading, }: RequireSessionProps): React__default.JSX.Element;
324
+
325
+ export { BrandBase, BrandEasygov, BrandFacebook, BrandKdk, BrandLinkedin, type BrandProps, BrandSeg, BrandSgv, BrandSsv, BrandSwiss, BrandXing, BrandYoutube, Button, type ButtonProps, type DesktopSpan, Dropdown, DropdownChip, DropdownChipsOverflow, type DropdownChipsOverflowProps, DropdownChipsTrigger, type DropdownChipsTriggerProps, DropdownCollection, DropdownEmpty, DropdownGroup, DropdownGroupLabel, DropdownHelperText, type DropdownHelperTextProps, DropdownInput, DropdownItem, type DropdownItemProps, DropdownItemText, DropdownLabel, type DropdownLabelProps, DropdownList, DropdownPopup, type DropdownPopupProps, DropdownSeparator, DropdownToggle, DropdownTrigger, type DropdownTriggerProps, DropdownValue, EasygovFooter, EasygovHeader, type EasygovHeaderProps, type EasygovSession, Grid, GridItem, type GridItemProps, type GridProps, Input, type InputProps, type Locale, type MobileSpan, NavigationMenu, NavigationMenuAnchor, type NavigationMenuAnchorProps, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, RequireSession, type RequireSessionProps, Select, SelectContent, type SelectContentProps, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, SelectHelperText, type SelectHelperTextProps, SelectItem, type SelectItemProps, SelectLabel, type SelectLabelProps, SelectSeparator, type SelectSeparatorProps, SelectTrigger, type SelectTriggerProps, type SessionUser, type TabletSpan, TextLink, type TextLinkProps, buttonVariants, textLinkVariants, useEasygovSession };