@eui/eds-react 22.0.0-alpha.10
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/eds-accordion/eds-accordion-item.css +108 -0
- package/eds-accordion/eds-accordion-item.d.ts +47 -0
- package/eds-accordion/eds-accordion-item.d.ts.map +1 -0
- package/eds-accordion/eds-accordion-item.js +87 -0
- package/eds-accordion/eds-accordion-item.js.map +1 -0
- package/eds-accordion/eds-accordion.css +7 -0
- package/eds-accordion/eds-accordion.d.ts +54 -0
- package/eds-accordion/eds-accordion.d.ts.map +1 -0
- package/eds-accordion/eds-accordion.js +79 -0
- package/eds-accordion/eds-accordion.js.map +1 -0
- package/eds-accordion/index.d.ts +5 -0
- package/eds-accordion/index.d.ts.map +1 -0
- package/eds-accordion/index.js +3 -0
- package/eds-accordion/index.js.map +1 -0
- package/eds-alert/eds-alert-title.css +5 -0
- package/eds-alert/eds-alert-title.d.ts +12 -0
- package/eds-alert/eds-alert-title.d.ts.map +1 -0
- package/eds-alert/eds-alert-title.js +12 -0
- package/eds-alert/eds-alert-title.js.map +1 -0
- package/eds-alert/eds-alert.css +62 -0
- package/eds-alert/eds-alert.d.ts +38 -0
- package/eds-alert/eds-alert.d.ts.map +1 -0
- package/eds-alert/eds-alert.js +29 -0
- package/eds-alert/eds-alert.js.map +1 -0
- package/eds-alert/index.d.ts +5 -0
- package/eds-alert/index.d.ts.map +1 -0
- package/eds-alert/index.js +3 -0
- package/eds-alert/index.js.map +1 -0
- package/eds-avatar/eds-avatar-badge.css +34 -0
- package/eds-avatar/eds-avatar-badge.d.ts +20 -0
- package/eds-avatar/eds-avatar-badge.d.ts.map +1 -0
- package/eds-avatar/eds-avatar-badge.js +13 -0
- package/eds-avatar/eds-avatar-badge.js.map +1 -0
- package/eds-avatar/eds-avatar-content-label.css +5 -0
- package/eds-avatar/eds-avatar-content-label.d.ts +13 -0
- package/eds-avatar/eds-avatar-content-label.d.ts.map +1 -0
- package/eds-avatar/eds-avatar-content-label.js +12 -0
- package/eds-avatar/eds-avatar-content-label.js.map +1 -0
- package/eds-avatar/eds-avatar-content-sublabel.css +5 -0
- package/eds-avatar/eds-avatar-content-sublabel.d.ts +13 -0
- package/eds-avatar/eds-avatar-content-sublabel.d.ts.map +1 -0
- package/eds-avatar/eds-avatar-content-sublabel.js +12 -0
- package/eds-avatar/eds-avatar-content-sublabel.js.map +1 -0
- package/eds-avatar/eds-avatar-content.css +6 -0
- package/eds-avatar/eds-avatar-content.d.ts +17 -0
- package/eds-avatar/eds-avatar-content.d.ts.map +1 -0
- package/eds-avatar/eds-avatar-content.js +12 -0
- package/eds-avatar/eds-avatar-content.js.map +1 -0
- package/eds-avatar/eds-avatar-icon.css +13 -0
- package/eds-avatar/eds-avatar-icon.d.ts +14 -0
- package/eds-avatar/eds-avatar-icon.d.ts.map +1 -0
- package/eds-avatar/eds-avatar-icon.js +13 -0
- package/eds-avatar/eds-avatar-icon.js.map +1 -0
- package/eds-avatar/eds-avatar-image.css +24 -0
- package/eds-avatar/eds-avatar-image.d.ts +19 -0
- package/eds-avatar/eds-avatar-image.d.ts.map +1 -0
- package/eds-avatar/eds-avatar-image.js +16 -0
- package/eds-avatar/eds-avatar-image.js.map +1 -0
- package/eds-avatar/eds-avatar-list.css +21 -0
- package/eds-avatar/eds-avatar-list.d.ts +14 -0
- package/eds-avatar/eds-avatar-list.d.ts.map +1 -0
- package/eds-avatar/eds-avatar-list.js +13 -0
- package/eds-avatar/eds-avatar-list.js.map +1 -0
- package/eds-avatar/eds-avatar-text.css +7 -0
- package/eds-avatar/eds-avatar-text.d.ts +14 -0
- package/eds-avatar/eds-avatar-text.d.ts.map +1 -0
- package/eds-avatar/eds-avatar-text.js +13 -0
- package/eds-avatar/eds-avatar-text.js.map +1 -0
- package/eds-avatar/eds-avatar.css +128 -0
- package/eds-avatar/eds-avatar.d.ts +38 -0
- package/eds-avatar/eds-avatar.d.ts.map +1 -0
- package/eds-avatar/eds-avatar.js +48 -0
- package/eds-avatar/eds-avatar.js.map +1 -0
- package/eds-avatar/index.d.ts +19 -0
- package/eds-avatar/index.d.ts.map +1 -0
- package/eds-avatar/index.js +10 -0
- package/eds-avatar/index.js.map +1 -0
- package/eds-badge/eds-badge.css +174 -0
- package/eds-badge/eds-badge.d.ts +46 -0
- package/eds-badge/eds-badge.d.ts.map +1 -0
- package/eds-badge/eds-badge.js +39 -0
- package/eds-badge/eds-badge.js.map +1 -0
- package/eds-badge/index.d.ts +3 -0
- package/eds-badge/index.d.ts.map +1 -0
- package/eds-badge/index.js +2 -0
- package/eds-badge/index.js.map +1 -0
- package/eds-button/eds-button.css +233 -0
- package/eds-button/eds-button.d.ts +65 -0
- package/eds-button/eds-button.d.ts.map +1 -0
- package/eds-button/eds-button.js +33 -0
- package/eds-button/eds-button.js.map +1 -0
- package/eds-button/index.d.ts +3 -0
- package/eds-button/index.d.ts.map +1 -0
- package/eds-button/index.js +2 -0
- package/eds-button/index.js.map +1 -0
- package/eds-chip/eds-chip.css +171 -0
- package/eds-chip/eds-chip.d.ts +71 -0
- package/eds-chip/eds-chip.d.ts.map +1 -0
- package/eds-chip/eds-chip.js +95 -0
- package/eds-chip/eds-chip.js.map +1 -0
- package/eds-chip/index.d.ts +3 -0
- package/eds-chip/index.d.ts.map +1 -0
- package/eds-chip/index.js +2 -0
- package/eds-chip/index.js.map +1 -0
- package/eds-chip-list/eds-chip-list.css +32 -0
- package/eds-chip-list/eds-chip-list.d.ts +68 -0
- package/eds-chip-list/eds-chip-list.d.ts.map +1 -0
- package/eds-chip-list/eds-chip-list.js +69 -0
- package/eds-chip-list/eds-chip-list.js.map +1 -0
- package/eds-chip-list/index.d.ts +3 -0
- package/eds-chip-list/index.d.ts.map +1 -0
- package/eds-chip-list/index.js +2 -0
- package/eds-chip-list/index.js.map +1 -0
- package/eds-icon/eds-icon.css +80 -0
- package/eds-icon/eds-icon.d.ts +44 -0
- package/eds-icon/eds-icon.d.ts.map +1 -0
- package/eds-icon/eds-icon.js +26 -0
- package/eds-icon/eds-icon.js.map +1 -0
- package/eds-icon/index.d.ts +3 -0
- package/eds-icon/index.d.ts.map +1 -0
- package/eds-icon/index.js +2 -0
- package/eds-icon/index.js.map +1 -0
- package/eds-icon-button/eds-icon-button.css +83 -0
- package/eds-icon-button/eds-icon-button.d.ts +33 -0
- package/eds-icon-button/eds-icon-button.d.ts.map +1 -0
- package/eds-icon-button/eds-icon-button.js +15 -0
- package/eds-icon-button/eds-icon-button.js.map +1 -0
- package/eds-icon-button/index.d.ts +3 -0
- package/eds-icon-button/index.d.ts.map +1 -0
- package/eds-icon-button/index.js +2 -0
- package/eds-icon-button/index.js.map +1 -0
- package/eds-icon-state/eds-icon-state.css +5 -0
- package/eds-icon-state/eds-icon-state.d.ts +24 -0
- package/eds-icon-state/eds-icon-state.d.ts.map +1 -0
- package/eds-icon-state/eds-icon-state.js +21 -0
- package/eds-icon-state/eds-icon-state.js.map +1 -0
- package/eds-icon-state/index.d.ts +3 -0
- package/eds-icon-state/index.d.ts.map +1 -0
- package/eds-icon-state/index.js +2 -0
- package/eds-icon-state/index.js.map +1 -0
- package/eds-link/eds-link.css +83 -0
- package/eds-link/eds-link.d.ts +32 -0
- package/eds-link/eds-link.d.ts.map +1 -0
- package/eds-link/eds-link.js +15 -0
- package/eds-link/eds-link.js.map +1 -0
- package/eds-link/index.d.ts +3 -0
- package/eds-link/index.d.ts.map +1 -0
- package/eds-link/index.js +2 -0
- package/eds-link/index.js.map +1 -0
- package/eds-menu/eds-menu-item-view.d.ts +31 -0
- package/eds-menu/eds-menu-item-view.d.ts.map +1 -0
- package/eds-menu/eds-menu-item-view.js +65 -0
- package/eds-menu/eds-menu-item-view.js.map +1 -0
- package/eds-menu/eds-menu-item.css +221 -0
- package/eds-menu/eds-menu-item.model.d.ts +69 -0
- package/eds-menu/eds-menu-item.model.d.ts.map +1 -0
- package/eds-menu/eds-menu-item.model.js +2 -0
- package/eds-menu/eds-menu-item.model.js.map +1 -0
- package/eds-menu/eds-menu.css +83 -0
- package/eds-menu/eds-menu.d.ts +52 -0
- package/eds-menu/eds-menu.d.ts.map +1 -0
- package/eds-menu/eds-menu.js +145 -0
- package/eds-menu/eds-menu.js.map +1 -0
- package/eds-menu/index.d.ts +6 -0
- package/eds-menu/index.d.ts.map +1 -0
- package/eds-menu/index.js +3 -0
- package/eds-menu/index.js.map +1 -0
- package/eds-shell/eds-shell-content.css +11 -0
- package/eds-shell/eds-shell-content.d.ts +11 -0
- package/eds-shell/eds-shell-content.d.ts.map +1 -0
- package/eds-shell/eds-shell-content.js +10 -0
- package/eds-shell/eds-shell-content.js.map +1 -0
- package/eds-shell/eds-shell-context.d.ts +20 -0
- package/eds-shell/eds-shell-context.d.ts.map +1 -0
- package/eds-shell/eds-shell-context.js +7 -0
- package/eds-shell/eds-shell-context.js.map +1 -0
- package/eds-shell/eds-shell-footer.css +25 -0
- package/eds-shell/eds-shell-footer.d.ts +12 -0
- package/eds-shell/eds-shell-footer.d.ts.map +1 -0
- package/eds-shell/eds-shell-footer.js +9 -0
- package/eds-shell/eds-shell-footer.js.map +1 -0
- package/eds-shell/eds-shell-header-app.css +23 -0
- package/eds-shell/eds-shell-header-app.d.ts +16 -0
- package/eds-shell/eds-shell-header-app.d.ts.map +1 -0
- package/eds-shell/eds-shell-header-app.js +11 -0
- package/eds-shell/eds-shell-header-app.js.map +1 -0
- package/eds-shell/eds-shell-header-end.css +5 -0
- package/eds-shell/eds-shell-header-end.d.ts +11 -0
- package/eds-shell/eds-shell-header-end.d.ts.map +1 -0
- package/eds-shell/eds-shell-header-end.js +10 -0
- package/eds-shell/eds-shell-header-end.js.map +1 -0
- package/eds-shell/eds-shell-header-environment.css +21 -0
- package/eds-shell/eds-shell-header-environment.d.ts +11 -0
- package/eds-shell/eds-shell-header-environment.d.ts.map +1 -0
- package/eds-shell/eds-shell-header-environment.js +10 -0
- package/eds-shell/eds-shell-header-environment.js.map +1 -0
- package/eds-shell/eds-shell-header-logo.css +14 -0
- package/eds-shell/eds-shell-header-logo.d.ts +20 -0
- package/eds-shell/eds-shell-header-logo.d.ts.map +1 -0
- package/eds-shell/eds-shell-header-logo.js +10 -0
- package/eds-shell/eds-shell-header-logo.js.map +1 -0
- package/eds-shell/eds-shell-header-start.css +5 -0
- package/eds-shell/eds-shell-header-start.d.ts +11 -0
- package/eds-shell/eds-shell-header-start.d.ts.map +1 -0
- package/eds-shell/eds-shell-header-start.js +10 -0
- package/eds-shell/eds-shell-header-start.js.map +1 -0
- package/eds-shell/eds-shell-header.css +33 -0
- package/eds-shell/eds-shell-header.d.ts +25 -0
- package/eds-shell/eds-shell-header.d.ts.map +1 -0
- package/eds-shell/eds-shell-header.js +14 -0
- package/eds-shell/eds-shell-header.js.map +1 -0
- package/eds-shell/eds-shell-menu-toggle.css +4 -0
- package/eds-shell/eds-shell-menu-toggle.d.ts +16 -0
- package/eds-shell/eds-shell-menu-toggle.d.ts.map +1 -0
- package/eds-shell/eds-shell-menu-toggle.js +20 -0
- package/eds-shell/eds-shell-menu-toggle.js.map +1 -0
- package/eds-shell/eds-shell-sidebar-bottom-nav.css +8 -0
- package/eds-shell/eds-shell-sidebar-bottom-nav.d.ts +20 -0
- package/eds-shell/eds-shell-sidebar-bottom-nav.d.ts.map +1 -0
- package/eds-shell/eds-shell-sidebar-bottom-nav.js +11 -0
- package/eds-shell/eds-shell-sidebar-bottom-nav.js.map +1 -0
- package/eds-shell/eds-shell-sidebar-footer.css +10 -0
- package/eds-shell/eds-shell-sidebar-footer.d.ts +10 -0
- package/eds-shell/eds-shell-sidebar-footer.d.ts.map +1 -0
- package/eds-shell/eds-shell-sidebar-footer.js +10 -0
- package/eds-shell/eds-shell-sidebar-footer.js.map +1 -0
- package/eds-shell/eds-shell-sidebar-header.css +33 -0
- package/eds-shell/eds-shell-sidebar-header.d.ts +16 -0
- package/eds-shell/eds-shell-sidebar-header.d.ts.map +1 -0
- package/eds-shell/eds-shell-sidebar-header.js +10 -0
- package/eds-shell/eds-shell-sidebar-header.js.map +1 -0
- package/eds-shell/eds-shell-sidebar-nav.css +9 -0
- package/eds-shell/eds-shell-sidebar-nav.d.ts +20 -0
- package/eds-shell/eds-shell-sidebar-nav.d.ts.map +1 -0
- package/eds-shell/eds-shell-sidebar-nav.js +11 -0
- package/eds-shell/eds-shell-sidebar-nav.js.map +1 -0
- package/eds-shell/eds-shell-sidebar.css +5 -0
- package/eds-shell/eds-shell-sidebar.d.ts +25 -0
- package/eds-shell/eds-shell-sidebar.d.ts.map +1 -0
- package/eds-shell/eds-shell-sidebar.js +15 -0
- package/eds-shell/eds-shell-sidebar.js.map +1 -0
- package/eds-shell/eds-shell-toolbar-app.css +23 -0
- package/eds-shell/eds-shell-toolbar-app.d.ts +16 -0
- package/eds-shell/eds-shell-toolbar-app.d.ts.map +1 -0
- package/eds-shell/eds-shell-toolbar-app.js +11 -0
- package/eds-shell/eds-shell-toolbar-app.js.map +1 -0
- package/eds-shell/eds-shell-toolbar-center.css +6 -0
- package/eds-shell/eds-shell-toolbar-center.d.ts +11 -0
- package/eds-shell/eds-shell-toolbar-center.d.ts.map +1 -0
- package/eds-shell/eds-shell-toolbar-center.js +10 -0
- package/eds-shell/eds-shell-toolbar-center.js.map +1 -0
- package/eds-shell/eds-shell-toolbar-end.css +23 -0
- package/eds-shell/eds-shell-toolbar-end.d.ts +11 -0
- package/eds-shell/eds-shell-toolbar-end.d.ts.map +1 -0
- package/eds-shell/eds-shell-toolbar-end.js +10 -0
- package/eds-shell/eds-shell-toolbar-end.js.map +1 -0
- package/eds-shell/eds-shell-toolbar-environment.css +21 -0
- package/eds-shell/eds-shell-toolbar-environment.d.ts +11 -0
- package/eds-shell/eds-shell-toolbar-environment.d.ts.map +1 -0
- package/eds-shell/eds-shell-toolbar-environment.js +10 -0
- package/eds-shell/eds-shell-toolbar-environment.js.map +1 -0
- package/eds-shell/eds-shell-toolbar-logo.css +11 -0
- package/eds-shell/eds-shell-toolbar-logo.d.ts +8 -0
- package/eds-shell/eds-shell-toolbar-logo.d.ts.map +1 -0
- package/eds-shell/eds-shell-toolbar-logo.js +10 -0
- package/eds-shell/eds-shell-toolbar-logo.js.map +1 -0
- package/eds-shell/eds-shell-toolbar-start.css +5 -0
- package/eds-shell/eds-shell-toolbar-start.d.ts +11 -0
- package/eds-shell/eds-shell-toolbar-start.d.ts.map +1 -0
- package/eds-shell/eds-shell-toolbar-start.js +10 -0
- package/eds-shell/eds-shell-toolbar-start.js.map +1 -0
- package/eds-shell/eds-shell-toolbar.css +37 -0
- package/eds-shell/eds-shell-toolbar.d.ts +27 -0
- package/eds-shell/eds-shell-toolbar.d.ts.map +1 -0
- package/eds-shell/eds-shell-toolbar.js +12 -0
- package/eds-shell/eds-shell-toolbar.js.map +1 -0
- package/eds-shell/eds-shell-top-message.css +48 -0
- package/eds-shell/eds-shell-top-message.d.ts +22 -0
- package/eds-shell/eds-shell-top-message.d.ts.map +1 -0
- package/eds-shell/eds-shell-top-message.js +24 -0
- package/eds-shell/eds-shell-top-message.js.map +1 -0
- package/eds-shell/eds-shell.css +105 -0
- package/eds-shell/eds-shell.d.ts +41 -0
- package/eds-shell/eds-shell.d.ts.map +1 -0
- package/eds-shell/eds-shell.js +116 -0
- package/eds-shell/eds-shell.js.map +1 -0
- package/eds-shell/index.d.ts +50 -0
- package/eds-shell/index.d.ts.map +1 -0
- package/eds-shell/index.js +25 -0
- package/eds-shell/index.js.map +1 -0
- package/eds-tag/eds-tag.css +83 -0
- package/eds-tag/eds-tag.d.ts +29 -0
- package/eds-tag/eds-tag.d.ts.map +1 -0
- package/eds-tag/eds-tag.js +14 -0
- package/eds-tag/eds-tag.js.map +1 -0
- package/eds-tag/index.d.ts +3 -0
- package/eds-tag/index.d.ts.map +1 -0
- package/eds-tag/index.js +2 -0
- package/eds-tag/index.js.map +1 -0
- package/eds-tooltip/eds-tooltip.css +140 -0
- package/eds-tooltip/eds-tooltip.d.ts +53 -0
- package/eds-tooltip/eds-tooltip.d.ts.map +1 -0
- package/eds-tooltip/eds-tooltip.js +179 -0
- package/eds-tooltip/eds-tooltip.js.map +1 -0
- package/eds-tooltip/index.d.ts +3 -0
- package/eds-tooltip/index.d.ts.map +1 -0
- package/eds-tooltip/index.js +2 -0
- package/eds-tooltip/index.js.map +1 -0
- package/index.d.ts +46 -0
- package/index.d.ts.map +1 -0
- package/index.js +31 -0
- package/index.js.map +1 -0
- package/package.json +115 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Local narrowed unions — the button's variant contract (ported 1:1 from the Angular
|
|
4
|
+
* `button[edsButton]`). No shared-token import.
|
|
5
|
+
*/
|
|
6
|
+
export type EdsButtonType = 'primary' | 'secondary' | 'tertiary';
|
|
7
|
+
/**
|
|
8
|
+
* Colors the button accepts. `primary` / `neutral` / `highlight` / `critical` have dedicated
|
|
9
|
+
* SCSS branches; `warning` is accepted (Angular via `edsWarning`) but has no styled branch —
|
|
10
|
+
* it renders the `eds-button--warning` class only, matching the Angular behavior.
|
|
11
|
+
*/
|
|
12
|
+
export type EdsButtonColor = 'primary' | 'neutral' | 'highlight' | 'critical' | 'warning';
|
|
13
|
+
/** Sizes the button styles (SCSS `eds-button--size-<size>` branches). */
|
|
14
|
+
export type EdsButtonSize = 's' | 'm' | 'l';
|
|
15
|
+
export interface EdsButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'type'> {
|
|
16
|
+
/**
|
|
17
|
+
* Visual type of the button. `primary` = solid surface; `secondary` = bordered;
|
|
18
|
+
* `tertiary` = text/ghost. Mirrors the Angular `edsTypeVariant` input and the
|
|
19
|
+
* `edsButtonPrimary`/`edsButtonSecondary`/`edsButtonTertiary` boolean shorthands.
|
|
20
|
+
* @default 'primary'
|
|
21
|
+
*/
|
|
22
|
+
type?: EdsButtonType;
|
|
23
|
+
/** Semantic color of the button. @default 'primary' */
|
|
24
|
+
color?: EdsButtonColor;
|
|
25
|
+
/** Size of the button. @default 'm' */
|
|
26
|
+
size?: EdsButtonSize;
|
|
27
|
+
/**
|
|
28
|
+
* Disables the button (adds the `disabled` attribute and disabled styling).
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/** Makes the button full-width (block-level). @default false */
|
|
33
|
+
block?: boolean;
|
|
34
|
+
/** Styles the button for icon-only content. @default false */
|
|
35
|
+
iconButton?: boolean;
|
|
36
|
+
/** Styles the button when used as an avatar trigger (e.g. actionable avatar). @default false */
|
|
37
|
+
avatarButton?: boolean;
|
|
38
|
+
/** Allows text content to wrap. @default false */
|
|
39
|
+
lineWrap?: boolean;
|
|
40
|
+
/** Applies a fully rounded border-radius. @default false */
|
|
41
|
+
rounded?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Marks the button as initially checked/selected within a button group. Kept for
|
|
44
|
+
* parity with the Angular `isChecked` input; read by a parent group.
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
checked?: boolean;
|
|
48
|
+
/** Data attribute for e2e testing. @default 'eds-button' */
|
|
49
|
+
e2eAttr?: string;
|
|
50
|
+
/** Optional projected content (label, icons). */
|
|
51
|
+
children?: React.ReactNode;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* `EdsButton` — pure React port of the Angular `button[edsButton]` component.
|
|
55
|
+
*
|
|
56
|
+
* The root element is a native `<button.eds-button>` (the host IS the button, matching the
|
|
57
|
+
* attribute-selector Angular component). This is a **class-based (pre-String-Props) source**:
|
|
58
|
+
* the Angular component computes a BEM `hostClasses()` string rather than reflecting host
|
|
59
|
+
* attributes, so the React port reproduces that BEM class logic verbatim in `className`, and
|
|
60
|
+
* the ported CSS keeps the `.eds-button.eds-button--type-primary` selectors (guide Part 1
|
|
61
|
+
* rule 9 — the sanctioned exception to the `data-*` rule). The label/icons are projected via
|
|
62
|
+
* `children` into the `.eds-button__container` wrapper, matching the Angular `<ng-content/>`.
|
|
63
|
+
*/
|
|
64
|
+
export declare const EdsButton: React.ForwardRefExoticComponent<EdsButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
65
|
+
//# sourceMappingURL=eds-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eds-button.d.ts","sourceRoot":"","sources":["../../src/eds-button/eds-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAEjE;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;AAE1F,yEAAyE;AACzE,MAAM,MAAM,aAAa,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAE5C,MAAM,WAAW,cACb,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7E;;;;;OAKG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,uDAAuD;IACvD,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,uCAAuC;IACvC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gGAAgG;IAChG,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,0FA+CpB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* `EdsButton` — pure React port of the Angular `button[edsButton]` component.
|
|
5
|
+
*
|
|
6
|
+
* The root element is a native `<button.eds-button>` (the host IS the button, matching the
|
|
7
|
+
* attribute-selector Angular component). This is a **class-based (pre-String-Props) source**:
|
|
8
|
+
* the Angular component computes a BEM `hostClasses()` string rather than reflecting host
|
|
9
|
+
* attributes, so the React port reproduces that BEM class logic verbatim in `className`, and
|
|
10
|
+
* the ported CSS keeps the `.eds-button.eds-button--type-primary` selectors (guide Part 1
|
|
11
|
+
* rule 9 — the sanctioned exception to the `data-*` rule). The label/icons are projected via
|
|
12
|
+
* `children` into the `.eds-button__container` wrapper, matching the Angular `<ng-content/>`.
|
|
13
|
+
*/
|
|
14
|
+
export const EdsButton = React.forwardRef(function EdsButton({ type = 'primary', color = 'primary', size = 'm', disabled = false, block = false, iconButton = false, avatarButton = false, lineWrap = false, rounded = false, checked: _checked = false, e2eAttr = 'eds-button', children, className, ...rest }, ref) {
|
|
15
|
+
// Angular `hostClasses()` computed — reproduced verbatim (BEM string).
|
|
16
|
+
const hostClasses = [
|
|
17
|
+
'eds-button',
|
|
18
|
+
`eds-button--size-${size}`,
|
|
19
|
+
`eds-button--${color}`,
|
|
20
|
+
`eds-button--type-${type}`,
|
|
21
|
+
rounded ? 'eds-button--rounded' : '',
|
|
22
|
+
block ? 'eds-button--block' : '',
|
|
23
|
+
iconButton ? 'eds-button--icon-only' : '',
|
|
24
|
+
avatarButton ? 'eds-button--avatar' : '',
|
|
25
|
+
lineWrap ? 'eds-button--line-wrap' : '',
|
|
26
|
+
className ?? '',
|
|
27
|
+
]
|
|
28
|
+
.join(' ')
|
|
29
|
+
.replace(/\s+/g, ' ')
|
|
30
|
+
.trim();
|
|
31
|
+
return (_jsx("button", { ref: ref, className: hostClasses, "data-e2e": e2eAttr, disabled: disabled || undefined, ...rest, children: _jsx("span", { className: "eds-button__container", children: children }) }));
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=eds-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eds-button.js","sourceRoot":"","sources":["../../src/eds-button/eds-button.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA0D/B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAoC,SAAS,SAAS,CAC3F,EACI,IAAI,GAAG,SAAS,EAChB,KAAK,GAAG,SAAS,EACjB,IAAI,GAAG,GAAG,EACV,QAAQ,GAAG,KAAK,EAChB,KAAK,GAAG,KAAK,EACb,UAAU,GAAG,KAAK,EAClB,YAAY,GAAG,KAAK,EACpB,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,OAAO,EAAE,QAAQ,GAAG,KAAK,EACzB,OAAO,GAAG,YAAY,EACtB,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACV,EACD,GAAG;IAEH,uEAAuE;IACvE,MAAM,WAAW,GAAG;QAChB,YAAY;QACZ,oBAAoB,IAAI,EAAE;QAC1B,eAAe,KAAK,EAAE;QACtB,oBAAoB,IAAI,EAAE;QAC1B,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE;QACpC,KAAK,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE;QAChC,UAAU,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE;QACzC,YAAY,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE;QACxC,QAAQ,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE;QACvC,SAAS,IAAI,EAAE;KAClB;SACI,IAAI,CAAC,GAAG,CAAC;SACT,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE,CAAC;IAEZ,OAAO,CACH,iBACI,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,WAAW,cACZ,OAAO,EACjB,QAAQ,EAAE,QAAQ,IAAI,SAAS,KAC3B,IAAI,YAER,eAAM,SAAS,EAAC,uBAAuB,YAAE,QAAQ,GAAQ,GACpD,CACZ,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eds-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eds-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* eds-chip — pure React port of eds-chip.scss.
|
|
3
|
+
*
|
|
4
|
+
* Angular emulated-encapsulation mapping (no shadow DOM here):
|
|
5
|
+
* :host -> .eds-chip (root class on the rendered element)
|
|
6
|
+
* :host([color="v"]) -> .eds-chip[data-color="v"]
|
|
7
|
+
* :host([size="v"]) -> .eds-chip[data-size="v"]
|
|
8
|
+
* :host([active]) (boolean) -> .eds-chip[data-active]
|
|
9
|
+
* :host([disabled]) -> .eds-chip[data-disabled]
|
|
10
|
+
* &:not([disabled]) -> .eds-chip:not([data-disabled])
|
|
11
|
+
* The --_eds-chip-* privates and --eds-* tokens are unchanged; tokens cascade in from the
|
|
12
|
+
* .eui-21 context (required on an ancestor), exactly like the Angular component. The focus
|
|
13
|
+
* ring is inlined from base.eds-focus-visible-ring-rounded().
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
.eds-chip {
|
|
17
|
+
/* default color = neutral */
|
|
18
|
+
--_eds-chip-surface: transparent;
|
|
19
|
+
--_eds-chip-on-surface: var(--eds-c-foreground-primary);
|
|
20
|
+
--_eds-chip-border-color: var(--eds-c-border-primary-subtle);
|
|
21
|
+
--_eds-chip-surface-hover: var(--eds-c-surface-primary-subtle);
|
|
22
|
+
--_eds-chip-on-surface-hover: var(--eds-c-on-surface-primary-subtle);
|
|
23
|
+
--_eds-chip-surface-active: var(--eds-c-surface-primary-subtle);
|
|
24
|
+
--_eds-chip-on-surface-active: var(--eds-c-on-surface-primary-subtle);
|
|
25
|
+
|
|
26
|
+
/* default size = m */
|
|
27
|
+
--_eds-chip-font: var(--eds-f-paragraph-s);
|
|
28
|
+
--_eds-chip-padding: var(--eds-sp-4xs) var(--eds-sp-2xs);
|
|
29
|
+
--_eds-chip-height: var(--eds-sp-xl);
|
|
30
|
+
|
|
31
|
+
/* a projected eds-icon follows the chip foreground (on-surface) color */
|
|
32
|
+
--_eds-icon-on-surface: var(--_eds-chip-on-surface);
|
|
33
|
+
|
|
34
|
+
border-radius: var(--eds-br-full);
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
border: var(--eds-bw-xs) solid var(--_eds-chip-border-color);
|
|
37
|
+
padding: var(--_eds-chip-padding);
|
|
38
|
+
font: var(--_eds-chip-font);
|
|
39
|
+
background-color: var(--_eds-chip-surface);
|
|
40
|
+
color: var(--_eds-chip-on-surface);
|
|
41
|
+
height: var(--_eds-chip-height);
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
gap: var(--eds-sp-2xs);
|
|
44
|
+
align-items: center;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* inlined base.eds-focus-visible-ring-rounded() */
|
|
48
|
+
.eds-chip:not([data-disabled]):focus-visible:not([readonly]) {
|
|
49
|
+
outline: var(--eds-bw-s) solid var(--eds-c-border-primary) !important;
|
|
50
|
+
outline-offset: 1px !important;
|
|
51
|
+
border-radius: var(--eds-br-full) !important;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.eds-chip:hover {
|
|
55
|
+
background-color: var(--_eds-chip-surface-hover);
|
|
56
|
+
color: var(--_eds-chip-on-surface-hover);
|
|
57
|
+
}
|
|
58
|
+
.eds-chip:active {
|
|
59
|
+
background-color: var(--_eds-chip-surface-active);
|
|
60
|
+
color: var(--_eds-chip-on-surface-active);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.eds-chip .eds-chip__content {
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
background: transparent;
|
|
67
|
+
gap: var(--eds-sp-2xs);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.eds-chip .eds-chip__close {
|
|
71
|
+
margin-left: var(--eds-sp-xs);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* SIZE VARIANTS
|
|
75
|
+
------------- */
|
|
76
|
+
|
|
77
|
+
.eds-chip[data-size="s"] {
|
|
78
|
+
--_eds-chip-font: var(--eds-f-paragraph-xs);
|
|
79
|
+
--_eds-chip-padding: var(--eds-sp-4xs) var(--eds-sp-3xs);
|
|
80
|
+
--_eds-chip-height: var(--eds-sp-l);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.eds-chip[data-size="m"] {
|
|
84
|
+
--_eds-chip-font: var(--eds-f-paragraph-s);
|
|
85
|
+
--_eds-chip-padding: var(--eds-sp-4xs) var(--eds-sp-2xs);
|
|
86
|
+
--_eds-chip-height: var(--eds-sp-xl);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.eds-chip[data-size="l"] {
|
|
90
|
+
--_eds-chip-font: var(--eds-f-paragraph-s);
|
|
91
|
+
--_eds-chip-padding: var(--eds-sp-3xs) var(--eds-sp-2xs);
|
|
92
|
+
--_eds-chip-height: var(--eds-sp-2xl);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* COLOR VARIANTS
|
|
96
|
+
-------------- */
|
|
97
|
+
|
|
98
|
+
.eds-chip[data-color="neutral"] {
|
|
99
|
+
--_eds-chip-surface: transparent;
|
|
100
|
+
--_eds-chip-on-surface: var(--eds-c-foreground-primary);
|
|
101
|
+
--_eds-chip-border-color: var(--eds-c-border-primary-subtle);
|
|
102
|
+
--_eds-chip-surface-hover: var(--eds-c-surface-primary-subtle);
|
|
103
|
+
--_eds-chip-on-surface-hover: var(--eds-c-on-surface-primary-subtle);
|
|
104
|
+
--_eds-chip-surface-active: var(--eds-c-surface-primary-subtle);
|
|
105
|
+
--_eds-chip-on-surface-active: var(--eds-c-on-surface-primary-subtle);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.eds-chip[data-color="info"] {
|
|
109
|
+
--_eds-chip-surface: transparent;
|
|
110
|
+
--_eds-chip-on-surface: var(--eds-c-foreground-info);
|
|
111
|
+
--_eds-chip-border-color: var(--eds-c-border-info-subtle);
|
|
112
|
+
--_eds-chip-surface-hover: var(--eds-c-surface-info-subtle);
|
|
113
|
+
--_eds-chip-on-surface-hover: var(--eds-c-on-surface-info-subtle);
|
|
114
|
+
--_eds-chip-surface-active: var(--eds-c-surface-info-subtle);
|
|
115
|
+
--_eds-chip-on-surface-active: var(--eds-c-on-surface-info-subtle);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.eds-chip[data-color="success"] {
|
|
119
|
+
--_eds-chip-surface: transparent;
|
|
120
|
+
--_eds-chip-on-surface: var(--eds-c-foreground-success);
|
|
121
|
+
--_eds-chip-border-color: var(--eds-c-border-success-subtle);
|
|
122
|
+
--_eds-chip-surface-hover: var(--eds-c-surface-success-subtle);
|
|
123
|
+
--_eds-chip-on-surface-hover: var(--eds-c-on-surface-success-subtle);
|
|
124
|
+
--_eds-chip-surface-active: var(--eds-c-surface-success-subtle);
|
|
125
|
+
--_eds-chip-on-surface-active: var(--eds-c-on-surface-success-subtle);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.eds-chip[data-color="warning"] {
|
|
129
|
+
--_eds-chip-surface: transparent;
|
|
130
|
+
--_eds-chip-on-surface: var(--eds-c-foreground-warning);
|
|
131
|
+
--_eds-chip-border-color: var(--eds-c-border-warning-subtle);
|
|
132
|
+
--_eds-chip-surface-hover: var(--eds-c-surface-warning-subtle);
|
|
133
|
+
--_eds-chip-on-surface-hover: var(--eds-c-on-surface-warning-subtle);
|
|
134
|
+
--_eds-chip-surface-active: var(--eds-c-surface-warning-subtle);
|
|
135
|
+
--_eds-chip-on-surface-active: var(--eds-c-on-surface-warning-subtle);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.eds-chip[data-color="critical"] {
|
|
139
|
+
--_eds-chip-surface: transparent;
|
|
140
|
+
--_eds-chip-on-surface: var(--eds-c-foreground-critical);
|
|
141
|
+
--_eds-chip-border-color: var(--eds-c-border-critical-subtle);
|
|
142
|
+
--_eds-chip-surface-hover: var(--eds-c-surface-critical-subtle);
|
|
143
|
+
--_eds-chip-on-surface-hover: var(--eds-c-on-surface-critical-subtle);
|
|
144
|
+
--_eds-chip-surface-active: var(--eds-c-surface-critical-subtle);
|
|
145
|
+
--_eds-chip-on-surface-active: var(--eds-c-on-surface-critical-subtle);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* STATE OVERRIDES
|
|
149
|
+
--------------- */
|
|
150
|
+
|
|
151
|
+
.eds-chip[data-active] {
|
|
152
|
+
--_eds-chip-surface: var(--eds-c-surface-primary);
|
|
153
|
+
--_eds-chip-on-surface: var(--eds-c-on-surface-primary);
|
|
154
|
+
--_eds-chip-border-color: transparent;
|
|
155
|
+
--_eds-chip-surface-hover: var(--eds-c-surface-primary--hover);
|
|
156
|
+
--_eds-chip-on-surface-hover: var(--eds-c-on-surface-primary--hover);
|
|
157
|
+
--_eds-chip-surface-active: var(--eds-c-surface-primary--pressed);
|
|
158
|
+
--_eds-chip-on-surface-active: var(--eds-c-on-surface-primary--pressed);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.eds-chip[data-disabled] {
|
|
162
|
+
--_eds-chip-surface: var(--eds-c-surface-disabled-subtle);
|
|
163
|
+
--_eds-chip-on-surface: var(--eds-c-foreground-disabled);
|
|
164
|
+
--_eds-chip-border-color: var(--eds-c-border-disabled);
|
|
165
|
+
--_eds-chip-surface-hover: var(--eds-c-surface-disabled-subtle);
|
|
166
|
+
--_eds-chip-on-surface-hover: var(--eds-c-foreground-disabled);
|
|
167
|
+
--_eds-chip-surface-active: var(--eds-c-surface-disabled-subtle);
|
|
168
|
+
--_eds-chip-on-surface-active: var(--eds-c-foreground-disabled);
|
|
169
|
+
|
|
170
|
+
cursor: default;
|
|
171
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Data structure for chip tooltip configuration (ported 1:1 from the Angular
|
|
4
|
+
* `eds-chip` `models/eui-chip.model.ts`).
|
|
5
|
+
*/
|
|
6
|
+
export interface EdsChipTooltip {
|
|
7
|
+
tooltipMessage?: string;
|
|
8
|
+
position?: 'above' | 'below' | 'left' | 'right' | 'before' | 'after';
|
|
9
|
+
contentAlignment?: 'center' | 'left' | 'right' | 'justify' | null;
|
|
10
|
+
delay?: number;
|
|
11
|
+
color?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Data payload emitted by chip events and passed via the `data` prop. */
|
|
14
|
+
export interface EdsChipData {
|
|
15
|
+
id?: string | number;
|
|
16
|
+
tooltip?: EdsChipTooltip;
|
|
17
|
+
/** Internal event reference, present when triggered via keyboard. */
|
|
18
|
+
_event?: Event;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Local narrowed color union — the chip's color contract (ported 1:1 from Angular `eds-chip`).
|
|
23
|
+
*/
|
|
24
|
+
export type EdsChipColor = 'neutral' | 'info' | 'success' | 'warning' | 'critical';
|
|
25
|
+
/** Local narrowed size union — the chip's size contract. */
|
|
26
|
+
export type EdsChipSize = 's' | 'm' | 'l';
|
|
27
|
+
export interface EdsChipProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'color' | 'id'> {
|
|
28
|
+
/** Semantic color of the chip. @default 'neutral' */
|
|
29
|
+
color?: EdsChipColor;
|
|
30
|
+
/** Size of the chip. @default 'm' */
|
|
31
|
+
size?: EdsChipSize;
|
|
32
|
+
/**
|
|
33
|
+
* Sets the `aria-label` attribute for the host element. When not set, assistive
|
|
34
|
+
* technology will use the text content of the chip. @default undefined
|
|
35
|
+
*/
|
|
36
|
+
ariaLabel?: string;
|
|
37
|
+
/** Data attribute for e2e testing. @default 'eds-chip' */
|
|
38
|
+
e2eAttr?: string;
|
|
39
|
+
/** Sets the edsInternalId of the chip. @default '' */
|
|
40
|
+
edsInternalId?: string;
|
|
41
|
+
/** Sets the label of the tooltip to display on hover. @default '' */
|
|
42
|
+
tooltipMessage?: string;
|
|
43
|
+
/** Sets the id of the chip. @default '' */
|
|
44
|
+
id?: string | number;
|
|
45
|
+
/** Sets the data of the chip like tooltip configuration. */
|
|
46
|
+
data?: EdsChipData;
|
|
47
|
+
/** Whether the chip can be removed. @default false */
|
|
48
|
+
isRemovable?: boolean;
|
|
49
|
+
/** Whether the chip is in active/pressed state. @default false */
|
|
50
|
+
isActive?: boolean;
|
|
51
|
+
/** Controls the disabled state of the chip. @default false */
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
/** Emitted when the chip is removed (Angular output `chipRemove`). */
|
|
54
|
+
onChipRemove?: (detail: EdsChipData) => void;
|
|
55
|
+
/** Emitted when the chip is clicked (Angular output `chipClick`). */
|
|
56
|
+
onChipClick?: (detail: EdsChipData) => void;
|
|
57
|
+
/** Projected content rendered inside the chip (matches Angular `<ng-content/>`). */
|
|
58
|
+
children?: React.ReactNode;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* `EdsChip` — pure React port of the Angular `eds-chip`.
|
|
62
|
+
*
|
|
63
|
+
* An interactive chip: it can be clicked (`onChipClick`), removed (`onChipRemove`, shown
|
|
64
|
+
* with a trailing remove icon when `isRemovable`), and toggled active/disabled. Host click,
|
|
65
|
+
* Enter, Space, Delete and Backspace keyboard behavior is reproduced (WAI-ARIA APG chip
|
|
66
|
+
* conventions). The rendered element IS the component (no wrapper). Requires
|
|
67
|
+
* `@eui/eds-styles` + the `eui-21` class on an ancestor for the `--eds-*` tokens to cascade
|
|
68
|
+
* in, and the sprite assets for the remove icon.
|
|
69
|
+
*/
|
|
70
|
+
export declare const EdsChip: React.ForwardRefExoticComponent<EdsChipProps & React.RefAttributes<HTMLSpanElement>>;
|
|
71
|
+
//# sourceMappingURL=eds-chip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eds-chip.d.ts","sourceRoot":"","sources":["../../src/eds-chip/eds-chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrE,gBAAgB,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,0EAA0E;AAC1E,MAAM,WAAW,WAAW;IACxB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,qEAAqE;IACrE,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,G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+
import { useContext, useRef } from 'react';
|
|
4
|
+
import { EdsIcon } from '../eds-icon/eds-icon.js';
|
|
5
|
+
import { EdsChipListContext } from '../eds-chip-list/eds-chip-list.js';
|
|
6
|
+
/** Maps a chip size to the size of its inner (remove) icon. */
|
|
7
|
+
const CHIP_ICON_SIZE = {
|
|
8
|
+
s: 'xs',
|
|
9
|
+
m: 's',
|
|
10
|
+
l: 'm',
|
|
11
|
+
};
|
|
12
|
+
/** Lazily builds the default `data` payload, mirroring the Angular input default. */
|
|
13
|
+
function defaultChipData() {
|
|
14
|
+
return {
|
|
15
|
+
id: crypto.randomUUID(),
|
|
16
|
+
tooltip: {
|
|
17
|
+
color: 'edsTooltipPrimary',
|
|
18
|
+
contentAlignment: null,
|
|
19
|
+
position: 'above',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* `EdsChip` — pure React port of the Angular `eds-chip`.
|
|
25
|
+
*
|
|
26
|
+
* An interactive chip: it can be clicked (`onChipClick`), removed (`onChipRemove`, shown
|
|
27
|
+
* with a trailing remove icon when `isRemovable`), and toggled active/disabled. Host click,
|
|
28
|
+
* Enter, Space, Delete and Backspace keyboard behavior is reproduced (WAI-ARIA APG chip
|
|
29
|
+
* conventions). The rendered element IS the component (no wrapper). Requires
|
|
30
|
+
* `@eui/eds-styles` + the `eui-21` class on an ancestor for the `--eds-*` tokens to cascade
|
|
31
|
+
* in, and the sprite assets for the remove icon.
|
|
32
|
+
*/
|
|
33
|
+
export const EdsChip = React.forwardRef(function EdsChip({ color = 'neutral', size = 'm', ariaLabel, e2eAttr = 'eds-chip', edsInternalId: _edsInternalId = '', tooltipMessage: _tooltipMessage = '', id = '', data, isRemovable = false, isActive = false, disabled = false, onChipRemove, onChipClick, children, className, onClick, onKeyDown, ...rest }, ref) {
|
|
34
|
+
const contentRef = useRef(null);
|
|
35
|
+
const iconSize = CHIP_ICON_SIZE[size];
|
|
36
|
+
// Angular: `hostRole = computed(() => this.chipList ? 'listitem' : 'button')`.
|
|
37
|
+
// Inside an EdsChipList (context = true) the chip is a list item; standalone it's a button.
|
|
38
|
+
const inChipList = useContext(EdsChipListContext);
|
|
39
|
+
const hostRole = inChipList ? 'listitem' : 'button';
|
|
40
|
+
// The `data` input has a per-instance default; keep it stable across renders.
|
|
41
|
+
const dataRef = useRef(undefined);
|
|
42
|
+
if (dataRef.current === undefined) {
|
|
43
|
+
dataRef.current = data ?? defaultChipData();
|
|
44
|
+
}
|
|
45
|
+
const chipData = data ?? dataRef.current;
|
|
46
|
+
const emitRemove = (event) => {
|
|
47
|
+
if (event instanceof KeyboardEvent && event.code === 'Backspace') {
|
|
48
|
+
onChipRemove?.({ ...chipData, _event: event });
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
onChipRemove?.(chipData);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const handleHostAction = (event) => {
|
|
55
|
+
if (disabled) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (isRemovable) {
|
|
59
|
+
emitRemove(event);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
onChipClick?.(chipData);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const handleClick = (event) => {
|
|
66
|
+
onClick?.(event);
|
|
67
|
+
handleHostAction(event.nativeEvent);
|
|
68
|
+
};
|
|
69
|
+
const handleKeyDown = (event) => {
|
|
70
|
+
onKeyDown?.(event);
|
|
71
|
+
const key = event.key;
|
|
72
|
+
if (key === 'Enter') {
|
|
73
|
+
handleHostAction(event.nativeEvent);
|
|
74
|
+
}
|
|
75
|
+
else if (key === ' ' || key === 'Spacebar') {
|
|
76
|
+
// Space activation — prevent page scroll and trigger the host action.
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
handleHostAction(event.nativeEvent);
|
|
79
|
+
}
|
|
80
|
+
else if (key === 'Delete' || key === 'Backspace') {
|
|
81
|
+
if (disabled || !isRemovable) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
emitRemove(event.nativeEvent);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
// Angular reads the projected text for the remove-icon aria-label. We approximate by
|
|
89
|
+
// reading the rendered content on demand (falls back to a generic label).
|
|
90
|
+
const removeLabel = `Remove ${contentRef.current?.textContent?.trim() ?? ''} chip`
|
|
91
|
+
.replace(/\s+/g, ' ')
|
|
92
|
+
.trim();
|
|
93
|
+
return (_jsxs("span", { ref: ref, className: className ? `eds-chip ${className}` : 'eds-chip', id: id !== '' ? String(id) : undefined, "data-color": color, "data-size": size, "data-removable": isRemovable ? '' : undefined, "data-active": isActive ? '' : undefined, "data-disabled": disabled ? '' : undefined, tabIndex: disabled ? -1 : 0, role: hostRole, "aria-disabled": disabled ? 'true' : undefined, "aria-pressed": isActive ? 'true' : undefined, "aria-label": ariaLabel, "data-e2e": e2eAttr, onClick: handleClick, onKeyDown: handleKeyDown, ...rest, children: [_jsx("div", { className: "eds-chip__content", ref: contentRef, children: children }), isRemovable ? (_jsx(EdsIcon, { className: "eds-chip__close", ariaLabel: removeLabel, ariaHidden: false, icon: "x:core", size: iconSize })) : null] }));
|
|
94
|
+
});
|
|
95
|
+
//# sourceMappingURL=eds-chip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eds-chip.js","sourceRoot":"","sources":["../../src/eds-chip/eds-chip.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AA+BvE,+DAA+D;AAC/D,MAAM,cAAc,GAAqC;IACrD,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;CACT,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AAC,CACX,KAAC,OAAO,IACJ,SAAS,EAAC,iBAAiB,EAC3B,SAAS,EAAE,WAAW,EACtB,UAAU,EAAE,KAAK,EACjB,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,QAAQ,GAChB,CACL,CAAC,CAAC,CAAC,IAAI,IACL,CACV,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eds-chip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EACR,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,cAAc,GACjB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eds-chip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* eds-chip-list — pure React port of eds-chip-list.scss.
|
|
3
|
+
*
|
|
4
|
+
* Angular emulated-encapsulation mapping (no shadow DOM here):
|
|
5
|
+
* :host -> .eds-chip-list (root class)
|
|
6
|
+
* :host .eds-chip-list__chip-container -> .eds-chip-list .eds-chip-list__chip-container
|
|
7
|
+
* eds-chip-list-additional-content:empty -> unchanged (custom-element selector)
|
|
8
|
+
* eds-chip-list-append-content:empty -> unchanged (custom-element selector)
|
|
9
|
+
* The --eds-* tokens are unchanged; they cascade in from the .eui-21 context (required on an
|
|
10
|
+
* ancestor), exactly like the Angular component.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
.eds-chip-list {
|
|
14
|
+
display: flex;
|
|
15
|
+
gap: var(--eds-sp-xs);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.eds-chip-list .eds-chip-list__chip-container {
|
|
19
|
+
align-items: center;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
gap: var(--eds-sp-xs);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.eds-chip-list .eds-chip-list__chip-container:empty {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.eds-chip-list eds-chip-list-additional-content:empty,
|
|
30
|
+
.eds-chip-list eds-chip-list-append-content:empty {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Context published by `EdsChipList` so a projected `EdsChip` can resolve its host role to
|
|
4
|
+
* `listitem` (the chip's standalone default is `button`). Mirrors the Angular
|
|
5
|
+
* `inject(EdsChipList, { optional: true })` relationship: a chip inside a list gets
|
|
6
|
+
* `role="listitem"`, a standalone chip keeps `role="button"`. Default `false` = no list.
|
|
7
|
+
*/
|
|
8
|
+
export declare const EdsChipListContext: React.Context<boolean>;
|
|
9
|
+
export interface EdsChipListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
/**
|
|
11
|
+
* ARIA label for the chip list container for screen reader accessibility.
|
|
12
|
+
* @default 'Chip list'
|
|
13
|
+
*/
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
/** Data attribute for e2e testing. @default 'eds-chip-list' */
|
|
16
|
+
e2eAttr?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Non-chip content excluded from the list ARIA structure — projected after the chip
|
|
19
|
+
* container (Angular `<ng-content select="eds-chip-list-additional-content">`). Prefer
|
|
20
|
+
* nesting an `<EdsChipListAdditionalContent>` in `children`; this prop is the slot analog.
|
|
21
|
+
*/
|
|
22
|
+
additionalContent?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Content appended after the additional content — for chip placement above/below/inside a
|
|
25
|
+
* text input (Angular `<ng-content select="eds-chip-list-append-content">`). Prefer nesting
|
|
26
|
+
* an `<EdsChipListAppendContent>` in `children`; this prop is the slot analog.
|
|
27
|
+
*/
|
|
28
|
+
appendContent?: React.ReactNode;
|
|
29
|
+
/** Chips (and optional slot sub-components) projected into the list. */
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* `EdsChipList` — pure React port of the Angular `eds-chip-list`.
|
|
34
|
+
*
|
|
35
|
+
* A semantic container for a group of `EdsChip`s. It renders a `role="list"` chip container
|
|
36
|
+
* (`aria-label` from `ariaLabel`) and reflects `data-e2e` on the host, matching the Angular
|
|
37
|
+
* template. It publishes `EdsChipListContext` so projected chips resolve `role="listitem"`.
|
|
38
|
+
*
|
|
39
|
+
* Slots (Angular multi-`<ng-content select>`): projected `EdsChipListAdditionalContent` /
|
|
40
|
+
* `EdsChipListAppendContent` children are pulled out of the chip container and rendered in
|
|
41
|
+
* their own structural positions (matching the Angular DOM order); everything else (the chips)
|
|
42
|
+
* stays inside the `role="list"` container. Equivalent `additionalContent` / `appendContent`
|
|
43
|
+
* props are also accepted for slot-style composition. The rendered element IS the component.
|
|
44
|
+
*/
|
|
45
|
+
export declare const EdsChipList: React.ForwardRefExoticComponent<EdsChipListProps & React.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
export interface EdsChipListAdditionalContentProps extends React.HTMLAttributes<HTMLElement> {
|
|
47
|
+
children?: React.ReactNode;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* `EdsChipListAdditionalContent` — pure React port of the Angular
|
|
51
|
+
* `eds-chip-list-additional-content` sub-component (`template: '<ng-content/>'`). Wraps
|
|
52
|
+
* non-chip content within an `eds-chip-list` and excludes it from the list ARIA structure.
|
|
53
|
+
* Renders as an `eds-chip-list-additional-content` custom element (matching the Angular
|
|
54
|
+
* selector, targeted by the `:empty` CSS rule).
|
|
55
|
+
*/
|
|
56
|
+
export declare const EdsChipListAdditionalContent: React.ForwardRefExoticComponent<EdsChipListAdditionalContentProps & React.RefAttributes<HTMLElement>>;
|
|
57
|
+
export interface EdsChipListAppendContentProps extends React.HTMLAttributes<HTMLElement> {
|
|
58
|
+
children?: React.ReactNode;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* `EdsChipListAppendContent` — pure React port of the Angular `eds-chip-list-append-content`
|
|
62
|
+
* sub-component (`template: '<ng-content/>'`). Appends content to the chip list, enabling chip
|
|
63
|
+
* placement above/below/inside a text input for autocomplete-like components. Renders as an
|
|
64
|
+
* `eds-chip-list-append-content` custom element (matching the Angular selector, targeted by
|
|
65
|
+
* the `:empty` CSS rule).
|
|
66
|
+
*/
|
|
67
|
+
export declare const EdsChipListAppendContent: React.ForwardRefExoticComponent<EdsChipListAppendContentProps & React.RefAttributes<HTMLElement>>;
|
|
68
|
+
//# sourceMappingURL=eds-chip-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eds-chip-list.d.ts","sourceRoot":"","sources":["../../src/eds-chip-list/eds-chip-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,wBAAgC,CAAC;AAEhE,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC1E;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC;;;;OAIG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,yFAqDtB,CAAC;AAEH,MAAM,WAAW,iCAAkC,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACxF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,uGAQxC,CAAC;AAEF,MAAM,WAAW,6BAA8B,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACpF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,mGAQpC,CAAC"}
|