@ni/ok-components 0.0.2

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.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Import of all the web components available in Nimble, Spright, and Ok.
3
+ * Production applications are encouraged to import only components
4
+ * that are required instead of leveraging this file.
5
+ */
6
+ import '@ni/nimble-components/dist/esm/all-components';
7
+ import '@ni/spright-components/dist/esm/all-components';
8
+ import './button';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Import of all the web components available in Nimble, Spright, and Ok.
3
+ * Production applications are encouraged to import only components
4
+ * that are required instead of leveraging this file.
5
+ */
6
+ import '@ni/nimble-components/dist/esm/all-components';
7
+ import '@ni/spright-components/dist/esm/all-components';
8
+ import './button';
9
+ //# sourceMappingURL=all-components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"all-components.js","sourceRoot":"","sources":["../../src/all-components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,+CAA+C,CAAC;AACvD,OAAO,gDAAgD,CAAC;AAExD,OAAO,UAAU,CAAC","sourcesContent":["/**\n * Import of all the web components available in Nimble, Spright, and Ok.\n * Production applications are encouraged to import only components\n * that are required instead of leveraging this file.\n */\n\nimport '@ni/nimble-components/dist/esm/all-components';\nimport '@ni/spright-components/dist/esm/all-components';\n\nimport './button';\n"]}
@@ -0,0 +1,12 @@
1
+ import { FoundationElement } from '@ni/fast-foundation';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'ok-button': Button;
5
+ }
6
+ }
7
+ /**
8
+ * A Ok demo component (not for production use)
9
+ */
10
+ export declare class Button extends FoundationElement {
11
+ }
12
+ export declare const buttonTag = "ok-button";
@@ -0,0 +1,16 @@
1
+ import { DesignSystem, FoundationElement } from '@ni/fast-foundation';
2
+ import { styles } from './styles';
3
+ import { template } from './template';
4
+ /**
5
+ * A Ok demo component (not for production use)
6
+ */
7
+ export class Button extends FoundationElement {
8
+ }
9
+ const okButton = Button.compose({
10
+ baseName: 'button',
11
+ template,
12
+ styles
13
+ });
14
+ DesignSystem.getOrCreate().withPrefix('ok').register(okButton());
15
+ export const buttonTag = 'ok-button';
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,iBAAiB;CAAG;AAEhD,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC;IAC5B,QAAQ,EAAE,QAAQ;IAClB,QAAQ;IACR,MAAM;CACT,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC","sourcesContent":["import { DesignSystem, FoundationElement } from '@ni/fast-foundation';\nimport { styles } from './styles';\nimport { template } from './template';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ok-button': Button;\n }\n}\n\n/**\n * A Ok demo component (not for production use)\n */\nexport class Button extends FoundationElement {}\n\nconst okButton = Button.compose({\n baseName: 'button',\n template,\n styles\n});\n\nDesignSystem.getOrCreate().withPrefix('ok').register(okButton());\nexport const buttonTag = 'ok-button';\n"]}
@@ -0,0 +1 @@
1
+ export declare const styles: import("@ni/fast-element").ElementStyles;
@@ -0,0 +1,28 @@
1
+ import { css } from '@ni/fast-element';
2
+ import { bodyDisabledFontColor, bodyFont, bodyFontColor, borderHoverColor, borderRgbPartialColor } from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';
3
+ import { display } from '../utilities/style/display';
4
+ export const styles = css `
5
+ ${display('inline-block')}
6
+
7
+ :host {
8
+ border: 2px solid ${borderHoverColor};
9
+ }
10
+
11
+ :host(:hover) {
12
+ border-width: 4px;
13
+ }
14
+
15
+ :host([disabled]) {
16
+ border-color: rgba(${borderRgbPartialColor}, 0.2);
17
+ }
18
+
19
+ slot {
20
+ font: ${bodyFont};
21
+ color: ${bodyFontColor};
22
+ }
23
+
24
+ :host([disabled]) slot {
25
+ color: ${bodyDisabledFontColor};
26
+ }
27
+ `;
28
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/button/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EACH,qBAAqB,EACrB,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACxB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;MACnB,OAAO,CAAC,cAAc,CAAC;;;4BAGD,gBAAgB;;;;;;;;6BAQf,qBAAqB;;;;gBAIlC,QAAQ;iBACP,aAAa;;;;iBAIb,qBAAqB;;CAErC,CAAC","sourcesContent":["import { css } from '@ni/fast-element';\nimport {\n bodyDisabledFontColor,\n bodyFont,\n bodyFontColor,\n borderHoverColor,\n borderRgbPartialColor\n} from '@ni/nimble-components/dist/esm/theme-provider/design-tokens';\nimport { display } from '../utilities/style/display';\n\nexport const styles = css`\n ${display('inline-block')}\n\n :host {\n border: 2px solid ${borderHoverColor};\n }\n\n :host(:hover) {\n border-width: 4px;\n }\n\n :host([disabled]) {\n border-color: rgba(${borderRgbPartialColor}, 0.2);\n }\n\n slot {\n font: ${bodyFont};\n color: ${bodyFontColor};\n }\n\n :host([disabled]) slot {\n color: ${bodyDisabledFontColor};\n }\n`;\n"]}
@@ -0,0 +1 @@
1
+ export declare const template: import("@ni/fast-element").ViewTemplate<any, any>;
@@ -0,0 +1,3 @@
1
+ import { html } from '@ni/fast-element';
2
+ export const template = html `<slot></slot>`;
3
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/button/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAA,eAAe,CAAC","sourcesContent":["import { html } from '@ni/fast-element';\n\nexport const template = html`<slot></slot>`;\n"]}
@@ -0,0 +1,8 @@
1
+ import { display as foundationDisplay } from '@ni/fast-foundation';
2
+ /**
3
+ * Each element should use the display utility which will create styles to:
4
+ * - Set the `:host` display property
5
+ * - Respond to the `hidden` attribute set on `:host`
6
+ * - Configure `box-sizing` for `:host`, all elements in shadow root, and `::before` / `::after` pseudoelements
7
+ */
8
+ export declare const display: typeof foundationDisplay;
@@ -0,0 +1,11 @@
1
+ import {
2
+ // eslint-disable-next-line no-restricted-imports
3
+ display as foundationDisplay } from '@ni/fast-foundation';
4
+ /**
5
+ * Each element should use the display utility which will create styles to:
6
+ * - Set the `:host` display property
7
+ * - Respond to the `hidden` attribute set on `:host`
8
+ * - Configure `box-sizing` for `:host`, all elements in shadow root, and `::before` / `::after` pseudoelements
9
+ */
10
+ export const display = (displayValue) => `${foundationDisplay(displayValue)}:host{box-sizing:border-box;}*{box-sizing:border-box;}:host::before,:host::after,::before,::after{box-sizing:border-box;}`;
11
+ //# sourceMappingURL=display.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display.js","sourceRoot":"","sources":["../../../../src/utilities/style/display.ts"],"names":[],"mappings":"AAAA,OAAO;AAEH,iDAAiD;AACjD,OAAO,IAAI,iBAAiB,EAC/B,MAAM,qBAAqB,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAA6B,CAC7C,YAAqC,EACvC,EAAE,CAAC,GAAG,iBAAiB,CAAC,YAAY,CAAC,2HAA2H,CAAC","sourcesContent":["import {\n type CSSDisplayPropertyValue,\n // eslint-disable-next-line no-restricted-imports\n display as foundationDisplay\n} from '@ni/fast-foundation';\n\n/**\n * Each element should use the display utility which will create styles to:\n * - Set the `:host` display property\n * - Respond to the `hidden` attribute set on `:host`\n * - Configure `box-sizing` for `:host`, all elements in shadow root, and `::before` / `::after` pseudoelements\n */\nexport const display: typeof foundationDisplay = (\n displayValue: CSSDisplayPropertyValue\n) => `${foundationDisplay(displayValue)}:host{box-sizing:border-box;}*{box-sizing:border-box;}:host::before,:host::after,::before,::after{box-sizing:border-box;}`;\n"]}
package/package.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "name": "@ni/ok-components",
3
+ "version": "0.0.2",
4
+ "description": "NI Ok Components",
5
+ "scripts": {
6
+ "build": "npm run build-components && npm run bundle-components",
7
+ "lint": "npm run eslint && npm run prettier",
8
+ "format": "npm run prettier-fix",
9
+ "eslint": "eslint .",
10
+ "eslint-fix": "eslint . --fix",
11
+ "prettier": "prettier-eslint \"**/*.*\" --list-different --prettier-ignore",
12
+ "prettier-fix": "prettier-eslint \"**/*.*\" --write --prettier-ignore",
13
+ "pack": "npm pack",
14
+ "invoke-publish": "npm publish",
15
+ "build-components": "tsc -p ./tsconfig.json",
16
+ "build-components:watch": "tsc -p ./tsconfig.json -w",
17
+ "bundle-components": "rollup --bundleConfigAsCjs --config",
18
+ "tdd": "npm run build-components && npm run test-chrome",
19
+ "tdd:watch": "npm run build-components:watch & npm run test-chrome:watch",
20
+ "tdd-firefox": "npm run build-components && npm run test-firefox",
21
+ "tdd-firefox:watch": "npm run build-components:watch & npm run test-firefox:watch",
22
+ "tdd-webkit": "npm run build-components && npm run test-webkit",
23
+ "tdd-webkit:watch": "npm run build-components:watch & npm run test-webkit:watch",
24
+ "test-chrome:debugger": "karma start karma.conf.js --browsers=ChromeDebugging --skip-tags SkipChrome",
25
+ "test-chrome:watch": "karma start karma.conf.headless.js --browsers=ChromeHeadlessOpt --skip-tags SkipChrome --watch-extensions js",
26
+ "test-chrome": "karma start karma.conf.headless.js --browsers=ChromeHeadlessOpt --single-run --skip-tags SkipChrome",
27
+ "test-firefox:debugger": "karma start karma.conf.js --browsers=FirefoxDebugging --skip-tags SkipFirefox",
28
+ "test-firefox:watch": "karma start karma.conf.headless.js --browsers=FirefoxHeadless --skip-tags SkipFirefox --watch-extensions js",
29
+ "test-firefox": "karma start karma.conf.headless.js --browsers=FirefoxHeadless --single-run --skip-tags SkipFirefox",
30
+ "test-webkit:debugger": "karma start karma.conf.js --browsers=WebkitDebugging --skip-tags SkipWebkit",
31
+ "test-webkit:watch": "karma start karma.conf.headless.js --browsers=WebkitHeadless --skip-tags SkipWebkit --watch-extensions js",
32
+ "test-webkit": "karma start karma.conf.headless.js --browsers=WebkitHeadless --single-run --skip-tags SkipWebkit",
33
+ "test": "npm run test-chrome && npm run test-firefox && npm run test-webkit"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/ni/nimble.git",
38
+ "directory": "packages/ok-components"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "author": {
44
+ "name": "National Instruments"
45
+ },
46
+ "license": "MIT",
47
+ "bugs": {
48
+ "url": "https://github.com/ni/nimble/issues"
49
+ },
50
+ "homepage": "https://github.com/ni/nimble#readme",
51
+ "dependencies": {
52
+ "@ni/fast-element": "^10.0.0",
53
+ "@ni/fast-foundation": "^10.1.2",
54
+ "@ni/fast-web-utilities": "^10.0.0",
55
+ "@ni/nimble-components": "^34.3.0",
56
+ "@ni/spright-components": "^6.3.0",
57
+ "tslib": "^2.2.0"
58
+ },
59
+ "devDependencies": {
60
+ "@ni/jasmine-parameterized": "^1.0.1",
61
+ "@ni-private/eslint-config-nimble": "*",
62
+ "@rollup/plugin-commonjs": "^28.0.0",
63
+ "@rollup/plugin-node-resolve": "^16.0.0",
64
+ "@rollup/plugin-replace": "^6.0.0",
65
+ "@rollup/plugin-terser": "^0.4.0",
66
+ "@types/jasmine": "^5.1.4",
67
+ "@types/webpack-env": "^1.15.2",
68
+ "jasmine-core": "^5.1.2",
69
+ "karma": "^6.3.0",
70
+ "karma-chrome-launcher": "^3.1.0",
71
+ "karma-firefox-launcher": "^2.1.0",
72
+ "karma-jasmine": "^5.1.0",
73
+ "karma-jasmine-html-reporter": "^2.0.0",
74
+ "karma-jasmine-spec-tags": "^2.0.0",
75
+ "karma-source-map-support": "^1.4.0",
76
+ "karma-sourcemap-loader": "^0.4.0",
77
+ "karma-spec-reporter": "^0.0.36",
78
+ "karma-webkit-launcher": "^2.6.0",
79
+ "karma-webpack": "^5.0.0",
80
+ "playwright": "1.53.1",
81
+ "prettier-eslint": "^16.3.0",
82
+ "prettier-eslint-cli": "^8.0.1",
83
+ "rollup": "^4.12.0",
84
+ "rollup-plugin-sourcemaps2": "^0.5.0",
85
+ "source-map-loader": "^5.0.0",
86
+ "typescript": "~5.4.5",
87
+ "webpack": "^5.75.0",
88
+ "webpack-dev-middleware": "^7.0.0"
89
+ }
90
+ }