@phila/phila-ui-core 2.0.1 → 2.1.1

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @phila/phila-ui-core
2
2
 
3
- Core utilities and styles for the Phila UI library. This package provides shared TypeScript utilities and design tokens for testing purposes.
3
+ Core utilities and styles for the Phila UI library. This package provides shared TypeScript utilities and design tokens used in the Phila UI components.
4
4
 
5
5
  ## Features
6
6
 
@@ -13,46 +13,113 @@ Core utilities and styles for the Phila UI library. This package provides shared
13
13
 
14
14
  ```bash
15
15
  pnpm add @phila/phila-ui-core
16
+ # or
17
+ npm install @phila/phila-ui-core
16
18
  ```
17
19
 
18
20
  ## Usage
19
21
 
20
- ### Design Tokens
22
+ ### Icons
23
+
24
+ The Phila UI design system uses [FontAwesome Pro](https://fontawesome.com/) for icons. Some components are bundled with static icons (FontAwesome Pro, version 7.0.1). To use additional icons throughout your application, you need to install FontAwesome and set the required NPM tokens in your environment.
25
+
26
+ ```bash
27
+ pnpm install @fortawesome/fontawesome-pro
28
+ ```
29
+
30
+ In a Vue project, you can import the CSS in your main entry file:
21
31
 
22
32
  ```typescript
23
- import { colors, spacing, typography, borderRadius } from "@phila/phila-ui-core";
24
-
25
- // Use design tokens in your styles
26
- const buttonStyles = {
27
- backgroundColor: colors.primary[500],
28
- padding: spacing[4],
29
- fontSize: typography.fontSizes.base,
30
- borderRadius: borderRadius.md,
31
- };
33
+ import "@fortawesome/fontawesome-pro/css/fontawesome.min.css";
34
+ import "@fortawesome/fontawesome-pro/css/solid.min.css";
32
35
  ```
33
36
 
34
- ### Class Name Utilities
37
+ If using nuxt, add the following to your `nuxt.config.ts`:
35
38
 
36
39
  ```typescript
37
- import { cn } from "@phila/phila-ui-core";
40
+ import { defineNuxtConfig } from "nuxt";
38
41
 
39
- // Combine class names efficiently
40
- const buttonClass = cn("base-button", "active", className);
42
+ export default defineNuxtConfig({
43
+ css: ["@fortawesome/fontawesome-pro/css/fontawesome.min.css", "@fortawesome/fontawesome-pro/css/solid.min.css"],
44
+ });
45
+ ```
46
+
47
+ In your project folder, create a `.npmrc` file with the following content:
48
+
49
+ ```
50
+ @fortawesome:registry=https://npm.fontawesome.com/
51
+ //npm.fontawesome.com/:_authToken=${NPM_FONTAWESOME_SECRET}
52
+ ```
53
+
54
+ ### Building components with icons
55
+
56
+ When building a component that uses a specific icon, you need to import the icon from the FontAwesome svg package and set it as a prop to the FontAwesome vue component.
57
+
58
+ ```bash
59
+ pnpm install --save-dev @fortawesome/fontawesome-svg-core @fortawesome/pro-regular-svg-icons @fortawesome/vue-fontawesome
60
+ ```
61
+
62
+ ```vue
63
+ <script lang="ts" setup>
64
+ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
65
+ import { faUser } from "@fortawesome/pro-solid-svg-icons";
66
+ </script>
67
+ <template>
68
+ ...
69
+ <FontAwesomeIcon :icon="faUser" />
70
+ ...
71
+ </template>
41
72
  ```
42
73
 
43
- ### Type Definitions
74
+ Additionally, you will need to configure vite.config.ts to treat the FontAwesome packages as external dependencies:
75
+
76
+ In packages/your-component/vite.config.ts:
44
77
 
45
78
  ```typescript
46
- import type { Size, Color, Variant, StyledProps } from "@phila/phila-ui-core";
79
+ export default defineConfig({
80
+ ...
81
+ build: {
82
+ ...
83
+ rollupOptions: {
84
+ external: ["other dependencies...", "@fortawesome/vue-fontawesome"],
85
+ ...
86
+ },
87
+ ...
88
+ },
89
+ });
90
+ ```
47
91
 
48
- interface ButtonProps extends StyledProps {
49
- children: React.ReactNode;
50
- onClick?: () => void;
92
+ And add vue-fontawesome as a peer dependency in your component's package.json:
93
+
94
+ ```json
95
+ "peerDependencies": {
96
+ ...
97
+ "@fortawesome/vue-fontawesome": "^3.1.2",
98
+ ...
51
99
  }
52
100
  ```
53
101
 
102
+ ### Phila UI Core Styles (Light mode):
103
+
104
+ In your main.ts file, import the core styles:
105
+
106
+ ```typescript
107
+ import "@phila/phila-ui-core/styles/template-light.css";
108
+ ```
109
+
110
+ ### Class Name Utilities
111
+
112
+ ```typescript
113
+ import { cn } from "@phila/phila-ui-core";
114
+
115
+ // Combine class names efficiently
116
+ const buttonClass = cn("base-button", "active", className);
117
+ ```
118
+
54
119
  ## Design Tokens
55
120
 
121
+ The package includes essential design tokens for consistent styling across components. These tokens are defined in CSS variables and can be used directly in your styles.
122
+
56
123
  ### Colors
57
124
 
58
125
  - **Primary**: Blue shades for main actions
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components.css');const e=require("./index-DkaNsoLU.js"),y={key:0,class:"input-errors"},k=e.defineComponent({__name:"ErrorList",props:{errors:{},validateOnBlur:{type:Boolean},validateOnInput:{type:Boolean},validateOnChange:{type:Boolean},validateOnMount:{type:Boolean},validate:{type:Function},required:{type:Boolean}},setup(o){const{errors:a,isValid:r}=e.useValidation(),n=o,t=e.computed(()=>Object.assign([],a.value,n.errors||[]));return(l,c)=>!e.unref(r)&&t.value?.length?(e.openBlock(),e.createElementBlock("div",y,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(u,i)=>(e.openBlock(),e.createElementBlock("li",{key:i},e.toDisplayString(u),1))),128))])])):e.createCommentVNode("",!0)}}),d=(o,a)=>{const r=o.__vccOpts||o;for(const[n,t]of a)r[n]=t;return r},p=d(k,[["__scopeId","data-v-caba8dd2"]]),O=["for"],I={key:0,class:"required"},b=e.defineComponent({__name:"InputLabel",props:{id:{},required:{type:Boolean}},setup(o){return(a,r)=>(e.openBlock(),e.createElementBlock("label",{class:"input-label",for:a.id},[e.renderSlot(a.$slots,"default",{},void 0),a.required?(e.openBlock(),e.createElementBlock("span",I,"*")):e.createCommentVNode("",!0)],8,O))}}),v=d(b,[["__scopeId","data-v-00c91174"]]),h=e.defineComponent({inheritAttrs:!1,__name:"InputWrap",props:{id:{},name:{},placeholder:{},label:{},icon:{},required:{type:Boolean},errors:{},validateOnBlur:{type:Boolean},validateOnInput:{type:Boolean},validateOnChange:{type:Boolean},validateOnMount:{type:Boolean},validate:{type:Function},className:{}},emits:["update:modelValue","input","change","focus","blur","keydown","keyup","keypress","error"],setup(o,{emit:a}){const{setInputValue:r}=e.useInput(),n=e.ref(""),t=o,l=a,{init:c,isValid:u,validation:i}=e.useValidation({validateOnMount:t.validateOnMount??!0,validateOnInput:t.validateOnInput??!0,validateOnBlur:t.validateOnBlur??!0,validateOnChange:t.validateOnChange??!0,required:t.required??!1,errors:t.errors||[],validate:t.validate},l),m=e.computed(()=>({invalid:!u.value})),B=s=>(n.value=s.target.value,l("update:modelValue",n.value),l("input",n.value),r(n.value),t.validateOnInput&&i(),n.value),_=()=>{t.validateOnBlur&&i(),l("blur")},f=()=>{l("focus")};return e.onBeforeMount(()=>{c()}),e.onMounted(()=>{t.validateOnMount&&i()}),(s,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input-wrap",{hasError:!e.unref(u)}])},[t.label?(e.openBlock(),e.createBlock(v,{key:0,id:t.id,required:t.required},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["id","required"])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"default",e.normalizeProps(e.guardReactiveProps({inputValue:n.value,onBlur:_,onFocus:f,onInput:B,isValid:e.unref(u),inputClasses:m.value})),void 0),e.createVNode(p)],2))}}),V=d(h,[["__scopeId","data-v-751bf20e"]]);exports.ErrorList=p;exports.InputLabel=v;exports.InputWrap=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components.css');const e=require("./index-DkaNsoLU.cjs"),y={key:0,class:"input-errors"},k=e.defineComponent({__name:"ErrorList",props:{errors:{},validateOnBlur:{type:Boolean},validateOnInput:{type:Boolean},validateOnChange:{type:Boolean},validateOnMount:{type:Boolean},validate:{type:Function},required:{type:Boolean}},setup(o){const{errors:a,isValid:r}=e.useValidation(),n=o,t=e.computed(()=>Object.assign([],a.value,n.errors||[]));return(l,c)=>!e.unref(r)&&t.value?.length?(e.openBlock(),e.createElementBlock("div",y,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(u,i)=>(e.openBlock(),e.createElementBlock("li",{key:i},e.toDisplayString(u),1))),128))])])):e.createCommentVNode("",!0)}}),d=(o,a)=>{const r=o.__vccOpts||o;for(const[n,t]of a)r[n]=t;return r},p=d(k,[["__scopeId","data-v-caba8dd2"]]),O=["for"],I={key:0,class:"required"},b=e.defineComponent({__name:"InputLabel",props:{id:{},required:{type:Boolean}},setup(o){return(a,r)=>(e.openBlock(),e.createElementBlock("label",{class:"input-label",for:a.id},[e.renderSlot(a.$slots,"default",{},void 0),a.required?(e.openBlock(),e.createElementBlock("span",I,"*")):e.createCommentVNode("",!0)],8,O))}}),v=d(b,[["__scopeId","data-v-00c91174"]]),h=e.defineComponent({inheritAttrs:!1,__name:"InputWrap",props:{id:{},name:{},placeholder:{},label:{},icon:{},required:{type:Boolean},errors:{},validateOnBlur:{type:Boolean},validateOnInput:{type:Boolean},validateOnChange:{type:Boolean},validateOnMount:{type:Boolean},validate:{type:Function},className:{}},emits:["update:modelValue","input","change","focus","blur","keydown","keyup","keypress","error"],setup(o,{emit:a}){const{setInputValue:r}=e.useInput(),n=e.ref(""),t=o,l=a,{init:c,isValid:u,validation:i}=e.useValidation({validateOnMount:t.validateOnMount??!0,validateOnInput:t.validateOnInput??!0,validateOnBlur:t.validateOnBlur??!0,validateOnChange:t.validateOnChange??!0,required:t.required??!1,errors:t.errors||[],validate:t.validate},l),m=e.computed(()=>({invalid:!u.value})),B=s=>(n.value=s.target.value,l("update:modelValue",n.value),l("input",n.value),r(n.value),t.validateOnInput&&i(),n.value),_=()=>{t.validateOnBlur&&i(),l("blur")},f=()=>{l("focus")};return e.onBeforeMount(()=>{c()}),e.onMounted(()=>{t.validateOnMount&&i()}),(s,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input-wrap",{hasError:!e.unref(u)}])},[t.label?(e.openBlock(),e.createBlock(v,{key:0,id:t.id,required:t.required},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["id","required"])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"default",e.normalizeProps(e.guardReactiveProps({inputValue:n.value,onBlur:_,onFocus:f,onInput:B,isValid:e.unref(u),inputClasses:m.value})),void 0),e.createVNode(p)],2))}}),V=d(h,[["__scopeId","data-v-751bf20e"]]);exports.ErrorList=p;exports.InputLabel=v;exports.InputWrap=V;
@@ -1,4 +1,4 @@
1
- import { d as c, u as m, c as y, a as l, b as v, e as p, o, f as V, F as k, r as q, t as B, g as O, h as C, i as M, j as E, k as F, l as L, m as N, n as $, p as w, q as x, w as j, s as z } from "./index-dajx1Lu4.mjs";
1
+ import { d as c, u as m, c as y, a as l, b as v, e as p, o, f as V, F as k, r as q, t as B, g as O, h as C, i as M, j as E, k as F, l as L, m as N, n as $, p as w, q as x, w as j, s as z } from "./index-dajx1Lu4.js";
2
2
  import './components.css';const P = {
3
3
  key: 0,
4
4
  class: "input-errors"
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DkaNsoLU.js");exports.useInput=e.useInput;exports.useValidation=e.useValidation;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DkaNsoLU.cjs");exports.useInput=e.useInput;exports.useValidation=e.useValidation;
@@ -1,4 +1,4 @@
1
- import { h as u, u as e } from "./index-dajx1Lu4.mjs";
1
+ import { h as u, u as e } from "./index-dajx1Lu4.js";
2
2
  export {
3
3
  u as useInput,
4
4
  e as useValidation
@@ -4,63 +4,103 @@ body {
4
4
  --Schemes-Primary: #003282;
5
5
  --Schemes-On-Primary-Container: #fff;
6
6
  --Schemes-Secondary-Container: #0086ab;
7
+ --Schemes-On-Secondary-Container: #fff;
7
8
  --Schemes-Inverse-Surface: #303030;
8
9
  --Schemes-Surface-Container-High: #c6c6c6;
9
10
  --Schemes-Surface-Container-Highest: #ababab;
10
11
  --Schemes-Error-Container: #ff5c5c;
11
12
  --Schemes-Error-Container-2: #d14922;
13
+ --Schemes-On-Error-Container: #fff;
12
14
  --Schemes-Surface-Container-Lowest: #fff;
13
15
  --Schemes-Surface-Container-Low: #f1f1f1;
16
+ --Schemes-Surface-Container: #e2e2e2;
14
17
  --Schemes-Outline: #5e5e5e;
15
18
  --Schemes-On-Surface: #000;
16
19
 
17
- --Label-font-label-family: "Montserrat", sans-serif;
20
+ /* label */
21
+ --Label-ExtraSmall-font-label-xs-family: "Montserrat", sans-serif;
22
+ --Label-ExtraSmall-font-label-xs-size: 0.75rem;
23
+ --Label-ExtraSmall-font-label-xs-lineheight: 1rem;
24
+
25
+ --Label-Default-font-label-default-family: "Montserrat", sans-serif;
18
26
  --Label-Default-font-label-default-size: 1rem;
19
- --Label-Default-font-label-default-lineheight: 1rem;
27
+ --Label-Default-font-label-default-lineheight: 1.5rem;
28
+
29
+ --Label-Large-font-label-large-family: "Montserrat", sans-serif;
30
+ --Label-Large-font-label-large-size: 1.125rem;
31
+ --Label-Large-font-label-large-lineheight: 1.75rem;
32
+
20
33
  --Label-Small-font-label-small-size: 0.875rem;
21
34
  --Label-Small-font-label-small-lineheight: 1.25rem;
22
-
23
- --Body-Default-font-body-default-family: "Montserrat";
35
+ /* Body */
36
+ --Body-Default-font-body-default-family: "Montserrat", sans-serif;
24
37
  --Body-Default-font-body-default-size: 1rem;
25
38
  --Body-Default-font-body-default-lineheight: 1.5rem;
26
39
 
27
- --Body-Small-font-body-small-family: "Montserrat";
40
+ --Body-Small-font-body-small-family: "Montserrat", sans-serif;
28
41
  --Body-Small-font-body-small-size: 0.875rem;
29
42
  --Body-Small-font-body-small-lineheight: 1.25rem;
30
43
 
31
- --Body-Large-font-body-large-family: "Montserrat";
44
+ --Body-Large-font-body-large-family: "Montserrat", sans-serif;
32
45
  --Body-Large-font-body-large-size: 1.125rem;
33
46
  --Body-Large-font-body-large-lineheight: 1.75rem;
34
47
 
35
- --Body-ExtraLarge-font-body-xlarge-family: "Montserrat";
48
+ --Body-ExtraLarge-font-body-xlarge-family: "Montserrat", sans-serif;
36
49
  --Body-ExtraLarge-font-body-xlarge-size: 1.5rem;
37
50
  --Body-ExtraLarge-font-body-xlarge-lineheight: 2.25rem;
51
+ /* Headings */
52
+ --Heading-H1-font-heading-1-family: "Montserrat", sans-serif;
53
+ --Heading-H1-font-heading-1-size: 3rem;
54
+ --Heading-H1-font-header-1-lineheight: 4rem;
55
+
56
+ --Heading-H2-font-heading-2-family: "Montserrat", sans-serif;
57
+ --Heading-H2-font-heading-2-size: 2.25rem;
58
+ --Heading-H2-font-heading-2-lineheight: 3rem;
59
+
60
+ --Heading-H3-font-heading-3-family: "Montserrat", sans-serif;
61
+ --Heading-H3-font-heading-3-size: 2rem;
62
+ --Heading-H3-font-heading-3-lineheight: 2.5rem;
63
+
64
+ --Heading-H4-font-heading-4-family: "Montserrat", sans-serif;
65
+ --Heading-H4-font-heading-4-size: 1.5rem;
66
+ --Heading-H4-font-heading-4-lineheight: 2.25rem;
67
+
68
+ --Heading-H5-font-heading-5-family: "Montserrat", sans-serif;
69
+ --Heading-H5-font-heading-5-size: 1.25rem;
70
+ --Heading-H5-font-heading-5-lineheight: 1.75rem;
71
+
72
+ --Heading-H6-font-heading-6-family: "Montserrat", sans-serif;
73
+ --Heading-H6-font-heading-6-size: 1rem;
74
+ --Heading-H6-font-heading-6-lineheight: 1.5rem;
75
+ /* Subtitles */
76
+ --Subtitle-font-subtitle-family: "Montserrat", sans-serif;
77
+ --Subtitle-Subtitle-1-font-subtitle-1-size: 1.5rem;
78
+ --Subtitle-Subtitle-1-font-subtitle-1-lineheight: 2.25rem;
79
+
80
+ --Subtitle-Subtitle-2-font-subtitle-2-size: 1.25rem;
81
+ --Subtitle-Subtitle-2-font-subtitle-2-lineheight: 1.75rem;
82
+ /* Display */
83
+ --Display-font-display-family: Montserrat, sans-serif;
84
+ --Display-Display-1-font-display-1-size: 4.5rem;
85
+ --Display-Display-1-font-display-1-lineheight: 5.5rem;
86
+
87
+ --Display-Display-2-font-display-2-size: 3.5rem;
88
+ --Display-Display-2-font-display-2-lineheight: 4.5rem;
89
+
90
+ /* Quotes */
91
+ --Quote-font-quote-family: "Times New Roman", serif;
92
+ --Quote-font-quote-size: 1.5rem;
93
+ --Quote-font-quote-lineheight: 2.25rem;
38
94
 
95
+ /* Icons */
39
96
  --Icon-Solid-Small-font-icon-solid-small-size: 1rem;
40
97
  --Icon-Solid-Default-font-icon-solid-default-size: 1.5rem;
41
98
  --Icon-Solid-Large-font-icon-solid-large-size: 2.25rem;
42
99
  --Icon-Solid-ExtraLarge-font-icon-solid-xl-size: 3rem;
43
-
44
- --scale-xxsmall: 0.125rem;
45
- --scale-xsmall: 0.25rem;
46
- --scale-small: 0.5rem;
47
- --scale-large: 1rem;
48
- --scale-6xlarge: 3.5rem;
100
+ --Icon-Solid-XXSmall-font-icon-solid-xxs-size: 0.75rem;
49
101
 
50
102
  --Static-Body-Large-Font: "Roboto", sans-serif;
51
103
  --Static-Body-Large-Size: 1rem;
52
104
  --Static-Body-Large-Line-Height: 1.5rem;
53
105
  --Static-Body-Large-Tracking: 0.03125rem;
54
- --Display-font-display-family: "Montserrat";
55
- --Display-Display-1-font-display-1-size: 4.5rem;
56
- --Display-Display-1-font-display-1-lineheight: 5.5rem;
57
- --scale-xxsmall: 0.125rem;
58
- --scale-xsmall: 0.25rem;
59
- --scale-small: 0.5rem;
60
- --scale-large: 1rem;
61
- --scale-6xlarge: 3.5rem;
62
-
63
- --Display-Display-2-font-display-2-size: 3.5rem;
64
- --Display-Display-2-font-display-2-lineheight: 4.5rem;
65
- --Display-Display-3-font-display-3-size: 2.5rem;
66
106
  }
@@ -1,4 +1,4 @@
1
- *:focus {
2
- outline-offset: var(--spacing-xs);
3
- outline: var(--stroke-stroke-thin, 2px) solid var(--Schemes-Primary-Container);
1
+ body {
2
+ font-size: 100%;
3
+ text-rendering: optimizeLegibility;
4
4
  }
@@ -2,5 +2,5 @@
2
2
  @import "./light-mode.css";
3
3
  @import "./typography.css";
4
4
  @import "./main.css";
5
- @import "./utilities.css";
6
- @import "./button.css";
5
+ @import "./utilities/index.css";
6
+ @import "./elements/index.css";
@@ -1,24 +1,22 @@
1
- @font-face {
2
- font-family: "Montserrat";
3
- src:
4
- local("Montserrat Regular"),
5
- local("Montserrat-Regular"),
6
- url("https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Regular.woff2") format("woff2"),
7
- url("https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Regular.woff") format("woff");
8
- font-weight: normal;
9
- font-style: normal;
10
- }
1
+ @import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,699;1,400;1,600&display=swap");
11
2
 
12
- .default-font,
13
- .content {
14
- font-family: var(--Body-Default-font-body-default-family);
15
- font-size: var(--Body-Default-font-body-default-size);
16
- font-style: normal;
17
- }
18
3
  /**
19
4
  TODO: figma not clear on margins between headings / paragraphs, or how these elements interact with each other
20
5
  **/
21
6
  .content {
7
+ /* Reset, based on https://www.joshwcomeau.com/css/custom-css-reset */
8
+ line-height: 1.5rem;
9
+ -webkit-font-smoothing: antialiased;
10
+ color: var(--Schemes-On-Surface);
11
+ *,
12
+ *::before,
13
+ *::after {
14
+ box-sizing: border-box;
15
+ }
16
+ * {
17
+ margin: 0;
18
+ }
19
+
22
20
  p,
23
21
  h1,
24
22
  h2,
@@ -26,8 +24,123 @@ TODO: figma not clear on margins between headings / paragraphs, or how these ele
26
24
  h4,
27
25
  h5,
28
26
  h6 {
29
- color: var(--Schemes-On-Surface);
27
+ overflow-wrap: break-word;
28
+ font-style: normal;
29
+ }
30
+ h1,
31
+ h2,
32
+ h3,
33
+ h4,
34
+ h5,
35
+ h6 {
36
+ text-wrap: balance;
37
+ }
38
+
39
+ p {
40
+ text-wrap: pretty;
41
+ }
42
+
43
+ /* Body text */
44
+
45
+ p {
46
+ font-family: var(--Body-Default-font-body-default-family);
47
+ font-weight: 400;
48
+ line-height: var(--Body-Default-font-body-default-lineheight);
49
+ &:not([class^="has-text-"]):not([class*=" has-text-"]),
50
+ &.has-text-body-small {
51
+ margin: 0 0 var(--spacing-l) 0;
52
+ }
53
+ &.has-text-body-large {
54
+ margin: 0 0 var(--spacing-xl) 0;
55
+ }
56
+ &.has-text-body-extra-large {
57
+ margin: 0 0 var(--spacing-xxl) 0;
58
+ }
59
+ }
60
+
61
+ /* Headings */
62
+ h1 {
63
+ font-family: var(--Heading-H1-font-heading-1-family);
64
+ font-size: var(--Heading-H1-font-heading-1-size);
30
65
  font-weight: 600;
31
- margin: 0;
66
+ line-height: var(--Heading-H1-font-header-1-lineheight);
67
+ margin: var(--spacing-xxl) 0;
68
+ }
69
+
70
+ h2 {
71
+ font-family: var(--Heading-H2-font-heading-2-family);
72
+ font-size: var(--Heading-H2-font-heading-2-size);
73
+ font-style: normal;
74
+ font-weight: 600;
75
+ line-height: var(--Heading-H2-font-heading-2-lineheight);
76
+ margin: var(--spacing-l) 0 var(--spacing-xxl) 0;
77
+ }
78
+ h3 {
79
+ font-family: var(--Heading-H3-font-heading-3-family);
80
+ font-size: var(--Heading-H3-font-heading-3-size);
81
+ font-style: normal;
82
+ font-weight: 600;
83
+ line-height: var(--Heading-H3-font-heading-3-lineheight);
84
+ margin: var(--spacing-l) 0 var(--spacing-xxl) 0;
85
+ }
86
+ h4 {
87
+ font-family: var(--Heading-H4-font-heading-4-family);
88
+ font-size: var(--Heading-H4-font-heading-4-size);
89
+ font-style: normal;
90
+ font-weight: 600;
91
+ line-height: var(--Heading-H4-font-heading-4-lineheight);
92
+ margin: var(--spacing-l) 0;
93
+ }
94
+ h5 {
95
+ font-family: var(--Heading-H5-font-heading-5-family);
96
+ font-size: var(--Heading-H5-font-heading-5-size);
97
+ font-style: normal;
98
+ font-weight: 600;
99
+ line-height: var(--Heading-H5-font-heading-5-lineheight);
100
+ margin: var(--spacing-l) 0;
101
+ }
102
+ h6 {
103
+ font-family: var(--Heading-H6-font-heading-6-family);
104
+ font-size: var(--Heading-H6-font-heading-6-size);
105
+ font-style: normal;
106
+ font-weight: 600;
107
+ line-height: var(--Heading-H6-font-heading-6-lineheight);
108
+ margin: var(--spacing-l) 0;
109
+ }
110
+
111
+ /* Quotes */
112
+
113
+ blockquote {
114
+ font-family: var(--Quote-font-quote-family);
115
+ font-size: var(--Quote-font-quote-size);
116
+ font-style: italic;
117
+ font-weight: 700;
118
+ line-height: var(--Quote-font-quote-lineheight);
119
+ margin: 0 0 var(--spacing-l) 0;
120
+ }
121
+
122
+ /* lists */
123
+
124
+ ul,
125
+ ol {
126
+ margin: var(--spacing-l) 0 0 0;
127
+ padding: 0 0 0 var(--spacing-3xl);
128
+ li {
129
+ margin: 0 0 var(--spacing-l) 0;
130
+ padding: 0 0 0 var(--spacing-s);
131
+ }
132
+ &:not(:last-child) {
133
+ margin-bottom: var(--spacing-l);
134
+ }
135
+ }
136
+
137
+ /* Others */
138
+ b,
139
+ strong {
140
+ font-weight: 600;
141
+ }
142
+ em,
143
+ cite {
144
+ font-style: italic;
32
145
  }
33
146
  }
@@ -50,8 +50,8 @@ TODO: we will need to update tokens.json to a more complete and updated version
50
50
  /* Colors/Mode 1 > Status */
51
51
  --status-green-light: #05ff47;
52
52
  /* Primitives/Mode 1 > spacing */
53
- --spacing-xs: 0.25rem;
54
53
  --spacing-xxs: 0.125rem;
54
+ --spacing-xs: 0.25rem;
55
55
  --spacing-s: 0.5rem;
56
56
  --spacing-m: 0.75rem;
57
57
  --spacing-l: 1rem;
@@ -62,6 +62,16 @@ TODO: we will need to update tokens.json to a more complete and updated version
62
62
  --spacing-5xl: 3rem;
63
63
  --spacing-6xl: 3.5rem;
64
64
  --spacing-7xl: 4rem;
65
+ /* scale, these are new from figma, assumptions made on medium -> large */
66
+ --scale-xxsmall: 0.125rem;
67
+ --scale-xsmall: 0.25rem;
68
+ --scale-small: 0.5rem;
69
+ --scale-medium: 0.75rem;
70
+ --scale-large: 1rem;
71
+ --scale-xlarge: 1.125rem;
72
+ --scale-xxlarge: 1.5rem;
73
+ --scale-3xlarge: 2rem;
74
+ --scale-6xlarge: 3.5rem;
65
75
  /* Primitives/Mode 1 > border widths */
66
76
  --border-width-xl: 1.125rem;
67
77
  --border-width-l: 1rem;
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@phila/phila-ui-core",
3
- "version": "2.0.1",
3
+ "version": "2.1.1",
4
+ "type": "module",
4
5
  "description": "Core utilities and styles for Phila UI library",
5
6
  "main": "./dist/index.js",
6
7
  "module": "./dist/index.mjs",
@@ -57,6 +58,8 @@
57
58
  "scripts": {
58
59
  "build": "vite build && npm run copy-css",
59
60
  "copy-css": "mkdir dist/styles && cp src/styles/*.css dist/styles/",
61
+ "build-win": "vite build && npm run copy-css-win",
62
+ "copy-css-win": "mkdir dist\\styles && copy src\\styles\\*.css dist\\styles\\",
60
63
  "dev": "vite build --watch",
61
64
  "lint": "eslint src/**/*.{ts,vue}",
62
65
  "lint:fix": "eslint src/**/*.{ts,vue} --fix",
@@ -1,203 +0,0 @@
1
- .phila-button {
2
- /* --- Base styles --- */
3
- display: inline-flex;
4
- justify-content: center;
5
- align-items: center;
6
- flex-shrink: 0;
7
- cursor: pointer;
8
- overflow: hidden;
9
- white-space: nowrap;
10
-
11
- /* --- Text styles --- */
12
- color: var(--Schemes-On-Primary-Container);
13
- font-family: var(--Label-font-label-family, Montserrat);
14
- font-size: var(--Label-Default-font-label-default-size, 1rem);
15
- font-style: normal;
16
- font-weight: 600;
17
- line-height: var(--Label-Default-font-label-default-lineheight);
18
-
19
- /* --- Reset button --- */
20
- border: none;
21
- /* Corrects font smoothing for webkit */
22
- -webkit-font-smoothing: inherit;
23
- -moz-osx-font-smoothing: inherit;
24
- /* Corrects inability to style clickable `input` types in iOS */
25
- appearance: none;
26
- -webkit-appearance: none;
27
-
28
- /* --- Sizing --- */
29
- height: var(--spacing-6xl, 3.25rem);
30
- max-width: 18.75rem;
31
- padding: var(--spacing-l, 0.5rem) var(--spacing-3xl);
32
- gap: var(--spacing-s);
33
- &.is-medium {
34
- height: var(--spacing-5xl, 3rem);
35
- padding: var(--spacing-m, 0.75rem) var(--spacing-xxl);
36
- gap: var(--spacing-s);
37
- }
38
- &.is-small {
39
- height: var(--spacing-3xl);
40
- padding: var(--spacing-s) var(--spacing-l);
41
- gap: var(--spacing-s);
42
- }
43
- &.is-extra-small {
44
- color: var(--Schemes-Primary-Container);
45
- height: var(--spacing-xxl);
46
- padding: var(--spacing-xxs);
47
- gap: var(--spacing-xxs);
48
- background-color: var(--Schemes-Surface-Container-Lowest) !important;
49
- font-family: var(--Label-font-label-family, Montserrat);
50
- font-size: var(--Label-Small-font-label-small-size);
51
- font-style: normal;
52
- font-weight: 600;
53
- line-height: var(--Label-Small-font-label-small-lineheight);
54
- border-color: var(--Schemes-Surface-Container-Lowest);
55
- border-width: var(--spacing-xxs);
56
- border-style: solid;
57
- box-sizing: border-box;
58
- border-left: none;
59
- border-right: none;
60
- &:focus,
61
- &:hover:not(:disabled) {
62
- --Schemes-On-Primary-Container: var(--Schemes-Inverse-Surface);
63
- border-bottom-color: var(--Schemes-Inverse-Surface);
64
- }
65
- &:active:not(:disabled) {
66
- color: var(--Schemes-Secondary-Container) !important;
67
- box-sizing: border-box;
68
- border: none;
69
- }
70
- &:disabled {
71
- color: var(--Schemes-Surface-Container-High);
72
- }
73
- &.phila-button--destructive:not(:active) {
74
- color: var(--Schemes-Error-Container) !important;
75
- }
76
- &.span-icon {
77
- }
78
- }
79
- /* --- States --- */
80
- &:hover:not(:disabled),
81
- &:focus:not(:disabled) {
82
- &:not(:active):not(.phila-button--secondary) {
83
- color: var(--Schemes-On-Primary-Container) !important;
84
- }
85
- &:not(.is-extra-small) {
86
- background-color: var(--Schemes-Inverse-Surface) !important;
87
- }
88
- }
89
- &:active:not(:disabled):not(.is-extra-small) {
90
- color: var(--Schemes-On-Primary-Container) !important;
91
- background: var(--Schemes-Secondary-Container) !important;
92
- }
93
- &:disabled {
94
- background: var(--Schemes-Surface-Container-High);
95
- cursor: not-allowed;
96
- }
97
-
98
- /* --- Variants --- */
99
- &.phila-button--primary:not(:disabled) {
100
- background: var(--Schemes-Primary-Container);
101
- }
102
-
103
- &.phila-button--secondary:not(:disabled) {
104
- color: var(--Schemes-Primary, #003282);
105
- background: var(--Schemes-Surface-Container-Lowest);
106
- &:not(:active):not(.is-extra-small) {
107
- border: var(--spacing-xxs) solid var(--Schemes-Primary);
108
- }
109
- &:active:not(:disabled):not(.is-extra-small) {
110
- border-right: var(--spacing-xxs) solid var(--Schemes-Surface-Container-Lowest);
111
- border-left: var(--spacing-xxs) solid var(--Schemes-Surface-Container-Lowest);
112
- }
113
- &:hover,
114
- &:focus {
115
- color: var(--Schemes-On-Primary-Container);
116
- }
117
- }
118
-
119
- &.phila-button--destructive:not(:disabled) {
120
- &:not(.is-extra-small) {
121
- background: var(--Schemes-Error-Container);
122
- }
123
- }
124
-
125
- /* --- Icons --- */
126
- /* TODO: break out to separate class for use outside of buttons */
127
- &.icon-button {
128
- padding: var(--spacing-xl);
129
- height: 5rem;
130
- width: 5rem;
131
- span.icon {
132
- font-size: var(--Icon-Solid-ExtraLarge-font-icon-solid-xl-size);
133
- font-style: normal;
134
- font-weight: 900;
135
- line-height: normal;
136
- }
137
-
138
- &.is-large {
139
- height: 3.75rem;
140
- width: 3.75rem;
141
- padding: var(--spacing-m);
142
- gap: var(--spacing-s);
143
- span.icon {
144
- font-size: var(--Icon-Solid-Large-font-icon-solid-large-size);
145
- }
146
- }
147
- &.is-medium {
148
- height: 3rem;
149
- width: 3rem;
150
- padding: var(--spacing-m);
151
- gap: var(--spacing-s);
152
- span.icon {
153
- font-size: var(--Icon-Solid-Default-font-icon-solid-default-size);
154
- }
155
- }
156
- &.is-small {
157
- height: 2rem;
158
- width: 2rem;
159
- padding: var(--spacing-s);
160
- gap: var(--spacing-s);
161
- span.icon {
162
- font-size: var(--Icon-Solid-Small-font-icon-solid-small-size);
163
- }
164
- }
165
- &.icon-button--standard:not(:disabled) {
166
- color: var(--Schemes-Primary, #003282);
167
- background: var(--Schemes-Surface-Container-Lowest);
168
- }
169
- }
170
- span.icon {
171
- height: auto;
172
- width: auto;
173
- font-style: normal;
174
- font-weight: 900;
175
- line-height: normal;
176
- font-size: var(--Icon-Solid-Small-font-icon-solid-small-size);
177
- }
178
-
179
- span.icon:first-child:not(:last-child) {
180
- margin-left: 0;
181
- margin-right: var(--spacing-s);
182
- + span {
183
- padding-right: var(--spacing-s);
184
- }
185
- }
186
- span.icon:last-child:not(:first-child) {
187
- margin: 0;
188
- padding: 0;
189
- }
190
- span:not([class="icon"]:only-child) {
191
- padding: 0 !important;
192
- }
193
- span:first-child:not([class="icon"]) {
194
- margin-left: 0 !important;
195
- margin-right: 0 !important;
196
- padding-left: var(--spacing-s);
197
- text-overflow: ellipsis;
198
- overflow: hidden;
199
- + span {
200
- margin-left: var(--spacing-s) !important;
201
- }
202
- }
203
- }
@@ -1,69 +0,0 @@
1
- /* TODO: create rest of color utility classes */
2
- .has-background-ben-franklin-blue {
3
- background-color: var(--dark-ben-franklin-blue);
4
- }
5
-
6
- .has-label-small-text {
7
- /* Label/Small */
8
- font-family: var(--Label-font-label-family);
9
- font-size: var(--Label-Small-font-label-small-size);
10
- font-style: normal;
11
- font-weight: 600;
12
- line-height: var(--Label-Small-font-label-small-lineheight);
13
- }
14
-
15
- .has-body-default-text {
16
- /* Body/Default */
17
- font-family: var(--Body-Default-font-body-default-family);
18
- font-size: var(--Body-Default-font-body-default-size);
19
- font-style: normal;
20
- font-weight: 400;
21
- line-height: var(--Body-Default-font-body-default-lineheight);
22
- }
23
-
24
- .has-body-small-text {
25
- /* Body/Small */
26
- font-family: var(--Body-Small-font-body-small-family);
27
- font-size: var(--Body-Small-font-body-small-size);
28
- font-style: normal;
29
- font-weight: 400;
30
- line-height: var(--Body-Small-font-body-small-lineheight);
31
- }
32
- .has-text-display-1 {
33
- font-family: var(--Display-font-display-family);
34
- font-size: var(--Display-Display-1-font-display-1-size);
35
- font-weight: 600;
36
- line-height: var(--Display-Display-1-font-display-1-lineheight);
37
- }
38
- .has-text-display-2 {
39
- font-family: var(--Display-font-display-family, Montserrat);
40
- font-size: var(--Display-Display-2-font-display-2-size);
41
- font-weight: 600;
42
- line-height: var(--Display-Display-2-font-display-2-lineheight);
43
- }
44
- .has-label-small-text {
45
- /* Label/Small */
46
- font-family: var(--Label-font-label-family);
47
- font-size: var(--Label-Small-font-label-small-size);
48
- font-style: normal;
49
- font-weight: 600;
50
- line-height: var(--Label-Small-font-label-small-lineheight);
51
- }
52
-
53
- .has-body-default-text {
54
- /* Body/Default */
55
- font-family: var(--Body-Default-font-body-default-family);
56
- font-size: var(--Body-Default-font-body-default-size);
57
- font-style: normal;
58
- font-weight: 400;
59
- line-height: var(--Body-Default-font-body-default-lineheight);
60
- }
61
-
62
- .has-body-small-text {
63
- /* Body/Small */
64
- font-family: var(--Body-Small-font-body-small-family);
65
- font-size: var(--Body-Small-font-body-small-size);
66
- font-style: normal;
67
- font-weight: 400;
68
- line-height: var(--Body-Small-font-body-small-lineheight);
69
- }
File without changes
File without changes