@scion/components 22.1.0 → 22.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.
Files changed (43) hide show
  1. package/_index.scss +75 -5
  2. package/common/package.json +4 -0
  3. package/design/_theming.scss +25 -10
  4. package/design/components/_scion-component-dark-tokens.scss +153 -0
  5. package/design/components/_scion-component-light-tokens.scss +153 -0
  6. package/design/icons/_scion-icon-font.scss +50 -0
  7. package/design/themes/_scion-dark-theme.scss +2 -7
  8. package/design/themes/_scion-light-theme.scss +3 -8
  9. package/fesm2022/scion-components-common.mjs +251 -0
  10. package/fesm2022/scion-components-common.mjs.map +1 -0
  11. package/fesm2022/scion-components-dimension.mjs +7 -6
  12. package/fesm2022/scion-components-dimension.mjs.map +1 -1
  13. package/fesm2022/scion-components-icon.mjs +380 -0
  14. package/fesm2022/scion-components-icon.mjs.map +1 -0
  15. package/fesm2022/scion-components-menu.mjs +3271 -0
  16. package/fesm2022/scion-components-menu.mjs.map +1 -0
  17. package/fesm2022/scion-components-sashbox.mjs +21 -21
  18. package/fesm2022/scion-components-sashbox.mjs.map +1 -1
  19. package/fesm2022/scion-components-splitter.mjs +16 -13
  20. package/fesm2022/scion-components-splitter.mjs.map +1 -1
  21. package/fesm2022/scion-components-table.mjs +2265 -0
  22. package/fesm2022/scion-components-table.mjs.map +1 -0
  23. package/fesm2022/scion-components-text.mjs +322 -0
  24. package/fesm2022/scion-components-text.mjs.map +1 -0
  25. package/fesm2022/scion-components-throbber.mjs +15 -15
  26. package/fesm2022/scion-components-throbber.mjs.map +1 -1
  27. package/fesm2022/scion-components-viewport.mjs +142 -125
  28. package/fesm2022/scion-components-viewport.mjs.map +1 -1
  29. package/icon/package.json +4 -0
  30. package/menu/package.json +4 -0
  31. package/package.json +22 -2
  32. package/table/package.json +4 -0
  33. package/text/package.json +4 -0
  34. package/types/scion-components-common.d.ts +185 -0
  35. package/types/scion-components-icon.d.ts +146 -0
  36. package/types/scion-components-menu.d.ts +1922 -0
  37. package/types/scion-components-sashbox.d.ts +4 -2
  38. package/types/scion-components-splitter.d.ts +4 -3
  39. package/types/scion-components-table.d.ts +577 -0
  40. package/types/scion-components-text.d.ts +131 -0
  41. package/types/scion-components-viewport.d.ts +32 -39
  42. package/viewport/scrollbar/_scrollbar.scss +4 -4
  43. package/design/components/_scion-component-tokens.scss +0 -48
@@ -0,0 +1,146 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Signal, EnvironmentProviders } from '@angular/core';
3
+ import { SciComponentDescriptor } from '@scion/components/common';
4
+ import { ComponentType } from '@angular/cdk/portal';
5
+
6
+ /**
7
+ * Renders an icon based on registered icon providers.
8
+ *
9
+ * Set the icon name as the slotted content of the `<sci-icon>` component.
10
+ *
11
+ * Example:
12
+ * ```html
13
+ * <sci-icon>home</sci-icon>
14
+ * ```
15
+ *
16
+ * An icon provider can be registered using {@link provideIconProvider}.
17
+ *
18
+ * Providers are called in registration order. If a provider does not provide the icon, the next provider is called, and so on.
19
+ * If no provider provides the icon, defaults to a Material icon provider, interpreting the icon as a Material icon font ligature.
20
+ * Refer to https://fonts.google.com/icons for available Material icons and instructions on including the Material icon font.
21
+ *
22
+ * By default, the icon size is `1em`. To change the size, set the font-size on the `<sci-icon>` element or use the `--sci-icon-size` CSS variable.
23
+ *
24
+ * ```scss
25
+ * sci-icon {
26
+ * --sci-icon-size: 16px;
27
+ * }
28
+ * ```
29
+ *
30
+ * @see provideIconProvider
31
+ *
32
+ * TODO [Angular 23] Consider changing encapsulation to `IsolatedShadowDom` when stable. See branch: issue/icon-shadow-dom.
33
+ */
34
+ declare class SciIconComponent {
35
+ private readonly _slottedContent;
36
+ protected readonly icon: Signal<SciComponentDescriptor | undefined>;
37
+ /**
38
+ * Reads the icon from slotted content and passes it to registered icon providers for resolution.
39
+ */
40
+ private computeIcon;
41
+ static ɵfac: i0.ɵɵFactoryDeclaration<SciIconComponent, never>;
42
+ static ɵcmp: i0.ɵɵComponentDeclaration<SciIconComponent, "sci-icon", never, {}, {}, never, ["*"], true, never>;
43
+ }
44
+
45
+ /**
46
+ * Enables contribution or replacement of icons used in SCION.
47
+ *
48
+ * An icon provider is a function that returns a component for an icon. The component renders the icon.
49
+ *
50
+ * Multiple icon providers can be registered. Providers are called in registration order. If a provider does not provide the icon,
51
+ * the next provider is called, and so on.
52
+ *
53
+ * Defaults to a Material icon provider, interpreting the icon as a Material icon ligature.
54
+ *
55
+ * Refer to https://fonts.google.com/icons for available Material icons and https://developers.google.com/fonts/docs/material_symbols#use_in_web
56
+ * for instructions on including the Material icon font.
57
+ *
58
+ * @example - Importing the Material icon font in `styles.scss`
59
+ * ```scss
60
+ * @import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..24,400,0&display=block');
61
+ * ```
62
+ *
63
+ * SCION uses the following built-in icons:
64
+ * - scion.add : Add an item
65
+ * - scion.add_large : Add an item (large)
66
+ * - scion.bin : Bin symbol
67
+ * - scion.checkmark : Indicates a selected option
68
+ * - scion.chevron_down : Chevron down symbol
69
+ * - scion.chevron_left : Chevron left symbol
70
+ * - scion.chevron_right : Chevron right symbol
71
+ * - scion.chevron_up : Chevron up symbol
72
+ * - scion.clear : Clear items
73
+ * - scion.close : Close a popover
74
+ * - scion.collapse_all : Collapse all items
75
+ * - scion.copy : Copy an item
76
+ * - scion.delete : Delete an item
77
+ * - scion.dirty : Indicates unsaved data
78
+ * - scion.drag_handle : Drag or move an item
79
+ * - scion.duplicate : Duplicate an item
80
+ * - scion.edit : Edit an item
81
+ * - scion.emdash : Em dash symbol
82
+ * - scion.envelope : Envelope symbol
83
+ * - scion.envelope_closed : Indicates a closed envelope
84
+ * - scion.envelope_opened : Indicates an opened envelope
85
+ * - scion.expand_all : Expand an item
86
+ * - scion.external_link : Open link in a new tab
87
+ * - scion.filter : Set or change a filter
88
+ * - scion.find : Find an item
89
+ * - scion.folder : Directory symbol
90
+ * - scion.help : Indicates help, support, or documentation
91
+ * - scion.hide : Hide a panel
92
+ * - scion.magnifier : Magnifier symbol
93
+ * - scion.minimize : Minimize a panel
94
+ * - scion.minus : Minus sign
95
+ * - scion.modified : Indicates modified data
96
+ * - scion.more_horizontal : Show a popover to the left or right
97
+ * - scion.more_vertical : Show a popover above or below
98
+ * - scion.new : Create an item
99
+ * - scion.new_large : Create an item (large)
100
+ * - scion.paste : Paste from clipboard
101
+ * - scion.pen : Pen symbol
102
+ * - scion.pin : Pin an item
103
+ * - scion.pinned : Indicates a pinned item
104
+ * - scion.placeholder_frame : Placeholder symbol
105
+ * - scion.placeholder_image : Placeholder symbol for an image
106
+ * - scion.plus : Plus sign
107
+ * - scion.plus_large : Plus sign (large)
108
+ * - scion.remove : Remove an item (x)
109
+ * - scion.remove_minus : Remove an item (-)
110
+ * - scion.reset : Reset a form
111
+ * - scion.search : Search for an item
112
+ * - scion.sort_ascending : Sort items in ascending order (A-Z, 0-9)
113
+ * - scion.sort_by : Change sort order
114
+ * - scion.sort_descending : Sort items in descending order (Z-A, 9-0)
115
+ * - scion.user : User symbol
116
+ *
117
+ * To not replace built-in icons, the icon provider can return `undefined` for icons starting with the `scion.` prefix.
118
+ *
119
+ * The function can call `inject` to get any required dependencies.
120
+ *
121
+ * @see SciIconProviderFn
122
+ * @see SciIconComponent
123
+ */
124
+ declare function provideIconProvider(iconProviderFn: SciIconProviderFn | undefined): EnvironmentProviders;
125
+ /**
126
+ * Signature of a function to provide icons.
127
+ *
128
+ * An icon provider is a function that returns the component for an icon. The component renders the icon.
129
+ *
130
+ * Alternatively, the icon provider can return a descriptor, allowing for additional configuration such as inputs.
131
+ * Inputs are available as input properties in the component. The component can use the inputs to render the icon.
132
+ *
133
+ * Icon keys used by SCION start with the `scion.` prefix. To not replace built-in icons, the icon provider can
134
+ * return `undefined` for icons starting with the `scion.` prefix.
135
+ *
136
+ * An icon provider can be registered via {@link provideIconProvider} function.
137
+ *
138
+ * The function can call `inject` to get any required dependencies.
139
+ *
140
+ * @param icon - The key of the icon for which to provide the icon component.
141
+ * @returns ComponentType or {@link SciComponentDescriptor} to render the icon, or `undefined` if not provided by the icon provider.
142
+ */
143
+ type SciIconProviderFn = (icon: string) => ComponentType<unknown> | SciComponentDescriptor | undefined;
144
+
145
+ export { SciIconComponent, provideIconProvider };
146
+ export type { SciIconProviderFn };