Skip to content

Commit

Permalink
fix: adding component entry files and missing sass files
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Friedberg authored and chrisfalaska committed Oct 7, 2024
1 parent 96bbadb commit 266aeb8
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 3 deletions.
19 changes: 16 additions & 3 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import { nodeResolve } from '@rollup/plugin-node-resolve';
import serve from 'rollup-plugin-serve';
import glob from 'glob';
import path from 'path';

const production = !process.env.ROLLUP_WATCH,
const production = !process.env.ROLLUP_WATCH;

modernConfig = {
// Function to get additional entry points
const getAdditionalEntryPoints = () => {
const files = glob.sync('src/*/index.js');
return files.reduce((acc, file) => {
const name = path.basename(path.dirname(file));
acc[`${name}__bundled`] = file;
return acc;
}, {});
};

const modernConfig = {
input: {
['auro-form__bundled']: './index.js',
...getAdditionalEntryPoints()
},
output: {
format: 'esm',
Expand All @@ -21,4 +34,4 @@ const production = !process.env.ROLLUP_WATCH,
]
};

export default [modernConfig];
export default [modernConfig];
96 changes: 96 additions & 0 deletions src/auro-input/color.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// See LICENSE in the project root for license information.

// ---------------------------------------------------------------------

// Support for fallback values
@import './../../node_modules/@aurodesignsystem/design-tokens/dist/tokens/SCSSVariables';

/* stylelint-disable */

/* stylelint-disable no-descending-specificity */

// Handle highlighting the border during focus and invalid state
@mixin border-highlight {
&:before {
border-bottom-color: transparent;
}
}

.wrapper {
border-color: transparent;
}

.inputElement-helpText {
color: var(--ds-auro-input-help-text-color);
}

input {
background-color: transparent;
caret-color: var(--ds-auro-input-caret-color);
color: var(--ds-auro-input-text-color);

&::placeholder {
color: transparent;
}

&:focus {
&::placeholder {
color: var(--ds-auro-input-placeholder-text-color);
}
}

&:disabled {
--ds-auro-input-input-text-color: var(--ds-color-text-ui-disabled-default, #{$ds-color-text-ui-disabled-default});
}
}

label {
color: var(--ds-auro-input-label-text-color);
}

:host(:not([bordered], [borderless])) {
.wrapper {
border-bottom-color: var(--ds-auro-input-border-color);
}
}

:host([bordered]) {
.wrapper {
border-color: var(--ds-auro-input-border-color);
background-color: var(--ds-auro-input-container-color);

&:focus-within {
--ds-auro-input-border-color: var(--ds-color-border-ui-focus-default, #{$ds-color-border-ui-focus-default});

box-shadow: inset 0 0 0 1px var(--ds-auro-input-border-color);
}
}
}

:host(:not([borderless])) {
.wrapper {
&:focus-within {
--ds-auro-input-border-color: var(--ds-color-border-ui-focus-default, #{$ds-color-border-ui-focus-default});

@include border-highlight;
}
}
}

:host([validity]:not([validity='valid'])) {
--ds-auro-input-border-color: var(--ds-color-border-error-default, #{$ds-color-border-error-default});
--ds-auro-input-help-text-color: var(--ds-color-text-error-default, #{$ds-color-text-error-default});
}

:host([validity]:not([validity='valid'])[bordered]) {
.wrapper {
--ds-auro-input-border-color: var(--ds-color-border-error-default, #{$ds-color-border-error-default});

box-shadow: inset 0 0 0 1px var(--ds-auro-input-border-color);
}
}

:host([disabled]) {
--ds-auro-input-border-color: var(--ds-color-border-ui-disabled-default, #{$ds-color-border-ui-disabled-default});
--ds-auro-input-label-text-color: var(--ds-color-text-ui-disabled-default, #{$ds-color-text-ui-disabled-default});
}
4 changes: 4 additions & 0 deletions src/auro-input/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { AuroInput } from './auro-input.js';
import * as RuntimeUtils from '@aurodesignsystem/auro-library/scripts/utils/runtimeUtils.mjs';

RuntimeUtils.default.prototype.registerComponent('custom-input', AuroInput);
11 changes: 11 additions & 0 deletions src/auro-input/tokens.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import './../../node_modules/@aurodesignsystem/design-tokens/dist/tokens/SCSSVariables';

:host {
--ds-auro-input-border-color: var(--ds-color-border-secondary-default, #{$ds-color-border-secondary-default});
--ds-auro-input-container-color: var(--ds-color-container-primary-default, #{$ds-color-container-primary-default});
--ds-auro-input-caret-color: var(--ds-color-text-ui-focus-default, #{$ds-color-text-ui-focus-default});
--ds-auro-input-help-text-color: var(--ds-color-text-tertiary-default, #{$ds-color-text-tertiary-default});
--ds-auro-input-label-text-color: var(--ds-color-text-tertiary-default, #{$ds-color-text-tertiary-default});
--ds-auro-input-placeholder-text-color: var(--ds-color-text-primary-default, #{$ds-color-text-primary-default});
--ds-auro-input-text-color: var(--ds-color-text-primary-default, #{$ds-color-text-primary-default});
}
4 changes: 4 additions & 0 deletions src/dropdown/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { AuroDropdown } from './auro-dropdown.js';
import * as RuntimeUtils from '@aurodesignsystem/auro-library/scripts/utils/runtimeUtils.mjs';

RuntimeUtils.default.prototype.registerComponent('custom-dropdown', AuroDropdown);

0 comments on commit 266aeb8

Please sign in to comment.