@ethlete/components 1.0.0-next.110 → 1.0.0-next.111

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.
@@ -71,6 +71,11 @@
71
71
  "schema": "./migrate-tabs-active-underline/schema.json",
72
72
  "description": "Remove the activeUnderline option from provideTabsConfig calls"
73
73
  },
74
+ "migrate-tab-bar-active-underline-input": {
75
+ "factory": "./migrate-tab-bar-active-underline-input/migration",
76
+ "schema": "./migrate-tab-bar-active-underline-input/schema.json",
77
+ "description": "Remove the activeUnderline input from tab group and nav tabs templates"
78
+ },
74
79
  "migrate-youtube-player-slot-directive": {
75
80
  "factory": "./migrate-youtube-player-slot-directive/migration",
76
81
  "schema": "./migrate-youtube-player-slot-directive/schema.json",
@@ -0,0 +1,41 @@
1
+ import { formatFiles } from '@nx/devkit';
2
+ import { createMigrationScope } from '../migrate-query-error-labels/migration-scope.js';
3
+ import { importsEthleteComponents, isTabBarTemplateCandidate, removeActiveUnderlineInput, } from './tab-bar-active-underline-input.js';
4
+ export default async function migrateTabBarActiveUnderlineInput(tree, schema) {
5
+ console.log('\nšŸ”Ž Removing the activeUnderline input from tab groups and nav tabs...');
6
+ const scope = createMigrationScope(tree, schema);
7
+ console.log(` Scope: ${scope.describe()}`);
8
+ const changed = [];
9
+ const needsRule = [];
10
+ scope.visit(tree, (filePath) => {
11
+ if (!isTabBarTemplateCandidate(filePath))
12
+ return;
13
+ const content = tree.read(filePath, 'utf-8');
14
+ if (!content)
15
+ return;
16
+ if (filePath.endsWith('.ts') && !importsEthleteComponents(content))
17
+ return;
18
+ const result = removeActiveUnderlineInput(content);
19
+ if (result === null)
20
+ return;
21
+ tree.write(filePath, result.content);
22
+ changed.push(filePath);
23
+ if (result.disabled)
24
+ needsRule.push(filePath);
25
+ });
26
+ if (!schema.skipFormat) {
27
+ await formatFiles(tree);
28
+ }
29
+ if (changed.length === 0) {
30
+ console.log('\nāœ… Nothing to do.');
31
+ return;
32
+ }
33
+ console.log(`\nāœ… Removed the activeUnderline input in ${changed.length} file(s).`);
34
+ if (needsRule.length > 0) {
35
+ console.log('\nāš ļø These files turned the active underline off or bound it to a value. Keep a bar without it with a host rule:');
36
+ for (const filePath of needsRule)
37
+ console.log(` ${filePath}`);
38
+ console.log(" .et-tab-group, .et-nav-tabs { --et-tab-bar-underline-size: 0px; --et-tab-baseline-size: 2px; }\n .et-tab-group[data-variant='primary'], .et-nav-tabs[data-variant='primary'] { --et-tab-baseline-size: 3px; }");
39
+ }
40
+ }
41
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1,26 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "migrate-tab-bar-active-underline-input",
4
+ "title": "Remove the activeUnderline input from tab group and nav tabs templates",
5
+ "type": "object",
6
+ "properties": {
7
+ "projects": {
8
+ "type": "array",
9
+ "items": { "type": "string" },
10
+ "description": "Nx projects to scan. Defaults to every project in the workspace.",
11
+ "alias": "project"
12
+ },
13
+ "include": {
14
+ "type": "array",
15
+ "items": { "type": "string" },
16
+ "description": "Path prefixes to scan, relative to the workspace root (e.g. 'apps/shop'). Unioned with `projects`.",
17
+ "alias": "includePath"
18
+ },
19
+ "skipFormat": {
20
+ "type": "boolean",
21
+ "description": "Skip formatting files after migration",
22
+ "default": false
23
+ }
24
+ },
25
+ "required": []
26
+ }
@@ -0,0 +1,23 @@
1
+ const TAG = /<(?:et-tab-group|et-nav-tabs)\b[^>]*>/g;
2
+ const INPUT = /[ \t]*\r?\n?[ \t]*(\[activeUnderline\]|activeUnderline)(?:\s*=\s*"([^"]*)")?(?=[\s/>])/;
3
+ export const isTabBarTemplateCandidate = (filePath) => (filePath.endsWith('.html') || (filePath.endsWith('.ts') && !filePath.endsWith('.d.ts'))) &&
4
+ !filePath.includes('node_modules');
5
+ export const importsEthleteComponents = (content) => /from\s*['"]@ethlete\/components(?:\/[^'"]*)?['"]/.test(content);
6
+ /**
7
+ * Returns the source without the `activeUnderline` input on `<et-tab-group>` and `<et-nav-tabs>`, or `null` when
8
+ * there is none. `disabled` is true when a removed value was not literally `true`.
9
+ */
10
+ export const removeActiveUnderlineInput = (content) => {
11
+ let disabled = false;
12
+ const next = content.replace(TAG, (tag) => {
13
+ const match = INPUT.exec(tag);
14
+ if (!match)
15
+ return tag;
16
+ const value = match[2]?.trim();
17
+ if (!(match[1] === '[activeUnderline]' && value === 'true'))
18
+ disabled = true;
19
+ return tag.replace(INPUT, '');
20
+ });
21
+ return next === content ? null : { content: next, disabled };
22
+ };
23
+ //# sourceMappingURL=tab-bar-active-underline-input.js.map
package/migrations.json CHANGED
@@ -233,6 +233,15 @@
233
233
  "description": "Remove --et-scrollable-buttons-end-space, which is removed, from stylesheets and inline styles: the inside buttons lie over the items.",
234
234
  "generator": "@ethlete/components:migrate-scrollable-end-space",
235
235
  "docs": "/components/scrollable"
236
+ },
237
+ {
238
+ "name": "tab-bar-active-underline-input",
239
+ "version": "1.0.0-next.111",
240
+ "kind": "auto",
241
+ "level": "required",
242
+ "description": "Remove the activeUnderline input of et-tab-group and et-nav-tabs, which is removed: where a bar turned it off, a host CSS rule (--et-tab-bar-underline-size: 0px) replaces it.",
243
+ "generator": "@ethlete/components:migrate-tab-bar-active-underline-input",
244
+ "docs": "/components/tabs"
236
245
  }
237
246
  ]
238
247
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/components",
3
- "version": "1.0.0-next.110",
3
+ "version": "1.0.0-next.111",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/ethlete-io/ethdk",
@@ -156,10 +156,6 @@
156
156
  border-radius: 0 var(--et-tab-bar-underline-size) var(--et-tab-bar-underline-size) 0;
157
157
  }
158
158
 
159
- [data-active-underline='false'] .et-tab-bar-underline--active {
160
- opacity: 0;
161
- }
162
-
163
159
  [data-underline-width='label'][data-orientation='horizontal'] .et-tab-group__trigger .et-tab-bar-underline {
164
160
  left: var(--et-tab-group-trigger-padding-inline);
165
161
  right: var(--et-tab-group-trigger-padding-inline);
@@ -35959,8 +35959,6 @@ export declare class TabBarDirective {
35959
35959
  align: import("@angular/core").InputSignal<TabBarAlign>;
35960
35960
  variant: import("@angular/core").InputSignal<TabBarVariant>;
35961
35961
  divider: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
35962
- /** Shows the underline under the active tab. Falls back to `provideTabsConfig`, then `true`. */
35963
- activeUnderline: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
35964
35962
  /** Whether the active underline spans the whole tab or only its label. Falls back to `provideTabsConfig`, then `'tab'`. */
35965
35963
  underlineWidth: import("@angular/core").InputSignal<TabUnderlineWidth | undefined>;
35966
35964
  /**
@@ -36008,11 +36006,6 @@ export declare class TabBarDirective {
36008
36006
  "required": false;
36009
36007
  "isSignal": true;
36010
36008
  };
36011
- "activeUnderline": {
36012
- "alias": "activeUnderline";
36013
- "required": false;
36014
- "isSignal": true;
36015
- };
36016
36009
  "underlineWidth": {
36017
36010
  "alias": "underlineWidth";
36018
36011
  "required": false;
@@ -36162,7 +36155,6 @@ export declare class NavTabsComponent {
36162
36155
  "align": "align";
36163
36156
  "divider": "divider";
36164
36157
  "variant": "variant";
36165
- "activeUnderline": "activeUnderline";
36166
36158
  "underlineWidth": "underlineWidth";
36167
36159
  "scrollableButtons": "scrollableButtons";
36168
36160
  "renderMasks": "renderMasks";
@@ -36360,7 +36352,6 @@ export declare class TabGroupComponent {
36360
36352
  "align": "align";
36361
36353
  "divider": "divider";
36362
36354
  "variant": "variant";
36363
- "activeUnderline": "activeUnderline";
36364
36355
  "underlineWidth": "underlineWidth";
36365
36356
  "scrollableButtons": "scrollableButtons";
36366
36357
  "renderMasks": "renderMasks";
@@ -37598,5 +37589,5 @@ export declare const provideUnsavedChangesLabels: (labels: import("@ethlete/core
37598
37589
  export declare const injectUnsavedChangesLabels: () => import("@angular/core").Signal<UnsavedChangesLabels>;
37599
37590
  export declare const UNSAVED_CHANGES_LABELS: import("@angular/core").InjectionToken<import("@ethlete/core").LabelsSource<UnsavedChangesLabels>>;
37600
37591
  /** The version of `@ethlete/components` this build was cut from. */
37601
- export declare const COMPONENTS_VERSION = "1.0.0-next.110";
37592
+ export declare const COMPONENTS_VERSION = "1.0.0-next.111";
37602
37593
  export { type AlertDialogComponentSlot, type AlertDialogSlot, type AlertDialogTemplateSlot, type AppointmentTreeNode, BRACKET_DATA_LAYOUT, BRACKET_ERROR_CODES, BRACKET_FINAL_ALIGNMENT, BRACKET_ROUND_MIRROR_TYPE, BRACKET_SECTION_KEY, BRACKET_SWISS_GROUP_COLOR_TYPE, type Bracket, type BracketByeSlotSource, type BracketComponents, type BracketContinueComponent, type BracketDataLayout, type BracketDataSource, type BracketDrawing, type BracketEdge, type BracketExternalSlotSource, type BracketFinalAlignment, type BracketGradient, type BracketGradientStop, type BracketGridSection, type BracketLayoutSettings, BracketMap, type BracketMatch, type BracketMatchComponent, type BracketMatchFactor, type BracketMatchId, type BracketMatchInputs, type BracketMatchOutcomeSlotSource, type BracketMatchParticipant, type BracketMatchPosition, type BracketMatchRelation, type BracketMatchRelationNone, type BracketMatchRelationNothingToOne, type BracketMatchRelationOneToNothing, type BracketMatchRelationOneToOne, type BracketMatchRelationTwoToNothing, type BracketMatchRelationTwoToOne, type BracketMatchShortId, type BracketMatchSlot, type BracketMatchSource, type BracketMatchStatus, type BracketParticipant, type BracketParticipantMatch, type BracketPickMigration, type BracketPickMigrationOptions, type BracketPickSet, type BracketRect, type BracketRound, type BracketRoundHeaderComponent, type BracketRoundId, type BracketRoundMapWithSwissData, type BracketRoundMirrorType, type BracketRoundPosition, type BracketRoundRelation, type BracketRoundRelationNone, type BracketRoundRelationNothingToOne, type BracketRoundRelationOneToNothing, type BracketRoundRelationOneToOne, type BracketRoundRelationTwoToNothing, type BracketRoundRelationTwoToOne, type BracketRoundShortId, type BracketRoundSource, type BracketRoundSwissData, type BracketRoundSwissGroup, type BracketRoundSwissGroupId, type BracketRoundSwissGroupMap, type BracketRoundType, BracketRuntimeError, type BracketSectionKey, type BracketSectionTitleComponent, type BracketSeedSlotSource, type BracketSlotResolutionPolicy, type BracketSlotSource, type BracketSlotSourceKind, type BracketStandingRankSide, type BracketStandingRankSlotSource, type BracketSwissBucketSlotSource, type BracketSwissColors, type BracketSwissGroupColorType, type BracketWarning, COMMON_BRACKET_ROUND_TYPE, type CalendarBandPosition, type CalendarInterval, type CalendarPrecision, type CalendarSelectionFlags, type CalendarView, type CalendarWeekStartsOn, type CascaderCompareWith, type CascaderDataSource, type CascaderNode, type CommonBracketRoundType, type ComputedBracketGrid, type CreateBracketGridConfig, type CreateBracketOptions, type CreateGridAdapterOptions, DOUBLE_ELIMINATION_BRACKET_ROUND_TYPE, type DateRangeSide, type DateRangeSide as TimeRangeInputSide, type DateRangeValue, type DateRangeValue as DateTimeRangeValue, type DateRangeValue as TimeRangeValue, type DoubleEliminationBracketRoundType, type DropzoneCropConfig, type DropzoneCropCorner, type DropzoneCropRect, type DropzoneCropShape, type DurationFormatSpec, type DurationSegment, type DurationUnit, GROUP_BRACKET_ROUND_TYPE, type GridAdapter, type GridAdapterBreakpoints, type GridConfig, type GroupBracketRoundType, type MatchParticipantId, type MatchParticipantShortId, type MatchParticipantSide, type ParticipantMatchResult, type PlaceholderBracketShape, type RichTextEditorHeadingLevel, type RichTextEditorImageFailure, type RichTextEditorImageFailureReason, type RichTextEditorImageUpload, type RichTextEditorImageUploadContext, type RichTextEditorImageUploadFn, type RichTextEditorTokenChip, type RichTextEditorTokenCodec, SINGLE_ELIMINATION_BRACKET_ROUND_TYPE, SWISS_BRACKET_ROUND_TYPE, type SchedulerAgendaDay, type SchedulerMonthDayCell, type SchedulerTimeGridAllDayEntry, type SchedulerTimeGridBlock, type SchedulerTimeGridDay, type SchedulerTimeGridSegment, type ScrollableActiveChildRef, type ScrollableButtonPosition, type ScrollableButtonsConfig, type ScrollableButtonsDefaults, type ScrollableChrome, type ScrollableChromeSlot, type ScrollableConfig, type ScrollableDirection, type ScrollableIntersectionChange, type ScrollableItemSize, type ScrollableLoadingTemplatePosition, type ScrollableLoadingTemplateRef, type ScrollableMaskVariant, type ScrollableNavigation, type ScrollableNavigationConfig, type ScrollableNavigationItem, type ScrollableResponsive, type ScrollableScrollMode, type ScrollableScrollOrigin, type ScrollableScrollState, type ScrollbarGeometry, type ScrollbarOrientation, type ScrollbarTarget, type SerializeOptions, type SingleEliminationBracketRoundType, type StandingPick, type StandingPickOutcome, type SwissBracketRoundType, TOURNAMENT_MODE, type TournamentMode, bracketSlot, createBracket, createPlaceholderBracketSource, injectRichTextEditorTools, isBracketSlotPredictable, migrateBracketPicks, resolveBracketSlot, standingRankSides, swapStandingRank, validateBracketSource };