@genesislcap/foundation-ui 14.489.0 → 14.489.1-alpha-519bcd2.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.
@@ -734,6 +734,17 @@ export declare const baseComponents: {
734
734
  }, Multiselect>;
735
735
  foundationNumberField: (overrideDefinition?: OverrideFoundationElementDefinition<NumberFieldOptions>) => FoundationElementRegistry<NumberFieldOptions, Constructable<FoundationElement>>;
736
736
  foundationOptgroup: (overrideDefinition?: OverrideFoundationElementDefinition<FoundationElementDefinition>) => FoundationElementRegistry<FoundationElementDefinition, Optgroup>;
737
+ foundationPill: (overrideDefinition?: OverrideFoundationElementDefinition< {
738
+ baseName: string;
739
+ template: ViewTemplate<Pill, any>;
740
+ styles: ElementStyles;
741
+ shadowOptions: ShadowRootInit;
742
+ }>) => FoundationElementRegistry< {
743
+ baseName: string;
744
+ template: ViewTemplate<Pill, any>;
745
+ styles: ElementStyles;
746
+ shadowOptions: ShadowRootInit;
747
+ }, Pill>;
737
748
  foundationPopper: (overrideDefinition?: OverrideFoundationElementDefinition< {
738
749
  baseName: string;
739
750
  styles: ElementStyles;
@@ -2169,6 +2180,8 @@ export declare const defaultNumberFieldConfig: {
2169
2180
  stepUpGlyph: string;
2170
2181
  };
2171
2182
 
2183
+ export declare const defaultPillConfig: {};
2184
+
2172
2185
  /**
2173
2186
  * @beta
2174
2187
  */
@@ -4083,6 +4096,29 @@ export declare const foundationOptgroupStyles: (_context: ElementDefinitionConte
4083
4096
 
4084
4097
  export declare const foundationOptgroupTemplate: (_context: ElementDefinitionContext, _definition: FoundationElementDefinition) => ViewTemplate<Optgroup, any>;
4085
4098
 
4099
+ /**
4100
+ * The Foundation Pill
4101
+ *
4102
+ * @public
4103
+ * @remarks
4104
+ * HTML Element: \<foundation-pill\>
4105
+ */
4106
+ export declare const foundationPill: (overrideDefinition?: OverrideFoundationElementDefinition< {
4107
+ baseName: string;
4108
+ template: ViewTemplate<Pill, any>;
4109
+ styles: ElementStyles;
4110
+ shadowOptions: ShadowRootInit;
4111
+ }>) => FoundationElementRegistry< {
4112
+ baseName: string;
4113
+ template: ViewTemplate<Pill, any>;
4114
+ styles: ElementStyles;
4115
+ shadowOptions: ShadowRootInit;
4116
+ }, typeof Pill>;
4117
+
4118
+ export declare const foundationPillShadowOptions: ShadowRootInit;
4119
+
4120
+ export declare const foundationPillTemplate: ViewTemplate<Pill, any>;
4121
+
4086
4122
  /**
4087
4123
  * The Foundation Popper
4088
4124
  *
@@ -5894,6 +5930,45 @@ export declare function parseDatePickerValue(dateString: string, displayFormat:
5894
5930
  */
5895
5931
  export declare function pathJoin(parts: string[], separator?: string, allowTrailingSeparator?: boolean): string;
5896
5932
 
5933
+ /**
5934
+ * @tagname %%prefix%%-pill
5935
+ *
5936
+ * @fires remove - Fired when the remove control is activated.
5937
+ * @fires pill-click - Fired when the pill body (excluding the remove control) is activated.
5938
+ */
5939
+ export declare class Pill extends FoundationElement {
5940
+ /**
5941
+ * @attr label - the name of the thing this pill represents, e.g. a filter field name
5942
+ * @example
5943
+ * ```html
5944
+ * <rapid-pill label="Cpty Desk"></rapid-pill>
5945
+ * ```
5946
+ */
5947
+ label: string;
5948
+ /**
5949
+ * @attr value - the current value shown alongside the label, e.g. "Cpty Desk: EQUITIES"
5950
+ * @example
5951
+ * ```html
5952
+ * <rapid-pill label="Cpty Desk" value="EQUITIES"></rapid-pill>
5953
+ * ```
5954
+ */
5955
+ value: string;
5956
+ /**
5957
+ * @attr removable - whether the "x" remove control is shown
5958
+ * @default true
5959
+ */
5960
+ removable: boolean;
5961
+ /**
5962
+ * @attr disabled - disables both the pill body and the remove control
5963
+ * @default false
5964
+ */
5965
+ disabled: boolean;
5966
+ handleBodyClick(): void;
5967
+ handleRemoveClick(event: Event): void;
5968
+ }
5969
+
5970
+ export declare const pillStyles: ElementStyles;
5971
+
5897
5972
  export declare const plusIcon: () => string;
5898
5973
 
5899
5974
  /**
package/dist/react.cjs CHANGED
@@ -64,6 +64,7 @@ const { NumberField: NumberFieldWC } = require('./esm/number-field/number-field.
64
64
  const { Optgroup: OptgroupWC } = require('./esm/optgroup/optgroup.js');
65
65
  const { MultiselectDatasource: MultiselectDatasourceWC } = require('./esm/options-datasource/multiselect-datasource.js');
66
66
  const { OptionsDatasource: OptionsDatasourceWC } = require('./esm/options-datasource/options-datasource.js');
67
+ const { Pill: PillWC } = require('./esm/pill/pill.js');
67
68
  const { Popper: PopperWC } = require('./esm/popper/popper.js');
68
69
  const { ProgressRing: ProgressRingWC } = require('./esm/progress-ring/progress-ring.js');
69
70
  const { Progress: ProgressWC } = require('./esm/progress/progress.js');
@@ -121,6 +122,11 @@ const ActionsMenu = React.forwardRef(function ActionsMenu(props, ref) {
121
122
  return React.createElement(customElements.getName(ActionsMenuWC) ?? '%%prefix%%-actions-menu', { ...rest, ref }, children);
122
123
  });
123
124
 
125
+ const Accordion = React.forwardRef(function Accordion(props, ref) {
126
+ const { children, ...rest } = props;
127
+ return React.createElement(customElements.getName(AccordionWC) ?? '%%prefix%%-accordion', { ...rest, ref }, children);
128
+ });
129
+
124
130
  const AiCriteriaSearch = React.forwardRef(function AiCriteriaSearch(props, ref) {
125
131
  const { onCriteriaChanged, onValidationErrors, children, ...rest } = props;
126
132
  const _innerRef = React.useRef(null);
@@ -143,11 +149,6 @@ const AiCriteriaSearch = React.forwardRef(function AiCriteriaSearch(props, ref)
143
149
  return React.createElement(customElements.getName(AiCriteriaSearchWC) ?? '%%prefix%%-ai-criteria-search', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
144
150
  });
145
151
 
146
- const Accordion = React.forwardRef(function Accordion(props, ref) {
147
- const { children, ...rest } = props;
148
- return React.createElement(customElements.getName(AccordionWC) ?? '%%prefix%%-accordion', { ...rest, ref }, children);
149
- });
150
-
151
152
  const AiIndicator = React.forwardRef(function AiIndicator(props, ref) {
152
153
  const { children, ...rest } = props;
153
154
  return React.createElement(customElements.getName(AiIndicatorWC) ?? '%%prefix%%-ai-indicator', { ...rest, ref }, children);
@@ -766,6 +767,28 @@ const OptionsDatasource = React.forwardRef(function OptionsDatasource(props, ref
766
767
  return React.createElement(customElements.getName(OptionsDatasourceWC) ?? 'options-datasource', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
767
768
  });
768
769
 
770
+ const Pill = React.forwardRef(function Pill(props, ref) {
771
+ const { onRemove, onPillClick, children, ...rest } = props;
772
+ const _innerRef = React.useRef(null);
773
+ const _onRemoveRef = React.useRef(onRemove);
774
+ _onRemoveRef.current = onRemove;
775
+ const _onPillClickRef = React.useRef(onPillClick);
776
+ _onPillClickRef.current = onPillClick;
777
+ React.useLayoutEffect(() => {
778
+ const el = _innerRef.current;
779
+ if (!el) return;
780
+ const _onRemoveFn = (e) => _onRemoveRef.current?.(e);
781
+ el.addEventListener('remove', _onRemoveFn);
782
+ const _onPillClickFn = (e) => _onPillClickRef.current?.(e);
783
+ el.addEventListener('pill-click', _onPillClickFn);
784
+ return () => {
785
+ el.removeEventListener('remove', _onRemoveFn);
786
+ el.removeEventListener('pill-click', _onPillClickFn);
787
+ };
788
+ }, []);
789
+ return React.createElement(customElements.getName(PillWC) ?? '%%prefix%%-pill', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
790
+ });
791
+
769
792
  const Popper = React.forwardRef(function Popper(props, ref) {
770
793
  const { children, ...rest } = props;
771
794
  return React.createElement(customElements.getName(PopperWC) ?? '%%prefix%%-popper', { ...rest, ref }, children);
@@ -1104,8 +1127,8 @@ const WeeklyRecurrence = React.forwardRef(function WeeklyRecurrence(props, ref)
1104
1127
  module.exports = {
1105
1128
  AccordionItem,
1106
1129
  ActionsMenu,
1107
- AiCriteriaSearch,
1108
1130
  Accordion,
1131
+ AiCriteriaSearch,
1109
1132
  AiIndicator,
1110
1133
  Anchor,
1111
1134
  AnchoredRegion,
@@ -1160,6 +1183,7 @@ module.exports = {
1160
1183
  Optgroup,
1161
1184
  MultiselectDatasource,
1162
1185
  OptionsDatasource,
1186
+ Pill,
1163
1187
  Popper,
1164
1188
  Progress,
1165
1189
  ProgressRing,
package/dist/react.mjs CHANGED
@@ -62,6 +62,7 @@ import { NumberField as NumberFieldWC } from './esm/number-field/number-field.js
62
62
  import { Optgroup as OptgroupWC } from './esm/optgroup/optgroup.js';
63
63
  import { MultiselectDatasource as MultiselectDatasourceWC } from './esm/options-datasource/multiselect-datasource.js';
64
64
  import { OptionsDatasource as OptionsDatasourceWC } from './esm/options-datasource/options-datasource.js';
65
+ import { Pill as PillWC } from './esm/pill/pill.js';
65
66
  import { Popper as PopperWC } from './esm/popper/popper.js';
66
67
  import { ProgressRing as ProgressRingWC } from './esm/progress-ring/progress-ring.js';
67
68
  import { Progress as ProgressWC } from './esm/progress/progress.js';
@@ -119,6 +120,11 @@ export const ActionsMenu = React.forwardRef(function ActionsMenu(props, ref) {
119
120
  return React.createElement(customElements.getName(ActionsMenuWC) ?? '%%prefix%%-actions-menu', { ...rest, ref }, children);
120
121
  });
121
122
 
123
+ export const Accordion = React.forwardRef(function Accordion(props, ref) {
124
+ const { children, ...rest } = props;
125
+ return React.createElement(customElements.getName(AccordionWC) ?? '%%prefix%%-accordion', { ...rest, ref }, children);
126
+ });
127
+
122
128
  export const AiCriteriaSearch = React.forwardRef(function AiCriteriaSearch(props, ref) {
123
129
  const { onCriteriaChanged, onValidationErrors, children, ...rest } = props;
124
130
  const _innerRef = React.useRef(null);
@@ -141,11 +147,6 @@ export const AiCriteriaSearch = React.forwardRef(function AiCriteriaSearch(props
141
147
  return React.createElement(customElements.getName(AiCriteriaSearchWC) ?? '%%prefix%%-ai-criteria-search', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
142
148
  });
143
149
 
144
- export const Accordion = React.forwardRef(function Accordion(props, ref) {
145
- const { children, ...rest } = props;
146
- return React.createElement(customElements.getName(AccordionWC) ?? '%%prefix%%-accordion', { ...rest, ref }, children);
147
- });
148
-
149
150
  export const AiIndicator = React.forwardRef(function AiIndicator(props, ref) {
150
151
  const { children, ...rest } = props;
151
152
  return React.createElement(customElements.getName(AiIndicatorWC) ?? '%%prefix%%-ai-indicator', { ...rest, ref }, children);
@@ -764,6 +765,28 @@ export const OptionsDatasource = React.forwardRef(function OptionsDatasource(pro
764
765
  return React.createElement(customElements.getName(OptionsDatasourceWC) ?? 'options-datasource', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
765
766
  });
766
767
 
768
+ export const Pill = React.forwardRef(function Pill(props, ref) {
769
+ const { onRemove, onPillClick, children, ...rest } = props;
770
+ const _innerRef = React.useRef(null);
771
+ const _onRemoveRef = React.useRef(onRemove);
772
+ _onRemoveRef.current = onRemove;
773
+ const _onPillClickRef = React.useRef(onPillClick);
774
+ _onPillClickRef.current = onPillClick;
775
+ React.useLayoutEffect(() => {
776
+ const el = _innerRef.current;
777
+ if (!el) return;
778
+ const _onRemoveFn = (e) => _onRemoveRef.current?.(e);
779
+ el.addEventListener('remove', _onRemoveFn);
780
+ const _onPillClickFn = (e) => _onPillClickRef.current?.(e);
781
+ el.addEventListener('pill-click', _onPillClickFn);
782
+ return () => {
783
+ el.removeEventListener('remove', _onRemoveFn);
784
+ el.removeEventListener('pill-click', _onPillClickFn);
785
+ };
786
+ }, []);
787
+ return React.createElement(customElements.getName(PillWC) ?? '%%prefix%%-pill', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
788
+ });
789
+
767
790
  export const Popper = React.forwardRef(function Popper(props, ref) {
768
791
  const { children, ...rest } = props;
769
792
  return React.createElement(customElements.getName(PopperWC) ?? '%%prefix%%-popper', { ...rest, ref }, children);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-ui",
3
3
  "description": "Genesis Foundation UI",
4
- "version": "14.489.0",
4
+ "version": "14.489.1-alpha-519bcd2.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -85,13 +85,13 @@
85
85
  }
86
86
  },
87
87
  "devDependencies": {
88
- "@genesislcap/foundation-testing": "14.489.0",
89
- "@genesislcap/genx": "14.489.0",
90
- "@genesislcap/rollup-builder": "14.489.0",
91
- "@genesislcap/ts-builder": "14.489.0",
92
- "@genesislcap/uvu-playwright-builder": "14.489.0",
93
- "@genesislcap/vite-builder": "14.489.0",
94
- "@genesislcap/webpack-builder": "14.489.0",
88
+ "@genesislcap/foundation-testing": "14.489.1-alpha-519bcd2.0",
89
+ "@genesislcap/genx": "14.489.1-alpha-519bcd2.0",
90
+ "@genesislcap/rollup-builder": "14.489.1-alpha-519bcd2.0",
91
+ "@genesislcap/ts-builder": "14.489.1-alpha-519bcd2.0",
92
+ "@genesislcap/uvu-playwright-builder": "14.489.1-alpha-519bcd2.0",
93
+ "@genesislcap/vite-builder": "14.489.1-alpha-519bcd2.0",
94
+ "@genesislcap/webpack-builder": "14.489.1-alpha-519bcd2.0",
95
95
  "copyfiles": "^2.4.1"
96
96
  },
97
97
  "dependencies": {
@@ -100,16 +100,16 @@
100
100
  "@fortawesome/free-regular-svg-icons": "^6.2.1",
101
101
  "@fortawesome/free-solid-svg-icons": "^6.2.1",
102
102
  "@genesiscommunitysuccess/analyzer-import-alias-plugin": "^5.0.3",
103
- "@genesislcap/expression-builder": "14.489.0",
104
- "@genesislcap/foundation-ai": "14.489.0",
105
- "@genesislcap/foundation-comms": "14.489.0",
106
- "@genesislcap/foundation-criteria": "14.489.0",
107
- "@genesislcap/foundation-errors": "14.489.0",
108
- "@genesislcap/foundation-events": "14.489.0",
109
- "@genesislcap/foundation-logger": "14.489.0",
110
- "@genesislcap/foundation-notifications": "14.489.0",
111
- "@genesislcap/foundation-user": "14.489.0",
112
- "@genesislcap/foundation-utils": "14.489.0",
103
+ "@genesislcap/expression-builder": "14.489.1-alpha-519bcd2.0",
104
+ "@genesislcap/foundation-ai": "14.489.1-alpha-519bcd2.0",
105
+ "@genesislcap/foundation-comms": "14.489.1-alpha-519bcd2.0",
106
+ "@genesislcap/foundation-criteria": "14.489.1-alpha-519bcd2.0",
107
+ "@genesislcap/foundation-errors": "14.489.1-alpha-519bcd2.0",
108
+ "@genesislcap/foundation-events": "14.489.1-alpha-519bcd2.0",
109
+ "@genesislcap/foundation-logger": "14.489.1-alpha-519bcd2.0",
110
+ "@genesislcap/foundation-notifications": "14.489.1-alpha-519bcd2.0",
111
+ "@genesislcap/foundation-user": "14.489.1-alpha-519bcd2.0",
112
+ "@genesislcap/foundation-utils": "14.489.1-alpha-519bcd2.0",
113
113
  "@microsoft/fast-colors": "5.3.1",
114
114
  "@microsoft/fast-components": "2.30.6",
115
115
  "@microsoft/fast-element": "1.14.0",
@@ -142,5 +142,5 @@
142
142
  "require": "./dist/react.cjs"
143
143
  }
144
144
  },
145
- "gitHead": "6c2cd6192531517879d0cf306d86e84a194fe961"
145
+ "gitHead": "3aaba760fec7b7e9bfebeffb78ecb2ec52a671d2"
146
146
  }