@bronzelabs/oakma-ui 0.0.1 → 0.0.3

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.
Files changed (123) hide show
  1. package/dist/index.d.ts +345 -0
  2. package/dist/index.js +2 -0
  3. package/dist/oakma-ui.css +2 -0
  4. package/package.json +7 -2
  5. package/.prettierrc.cjs +0 -25
  6. package/.storybook/components/ActionButton.tsx +0 -44
  7. package/.storybook/components/DummyIcons.tsx +0 -47
  8. package/.storybook/components/index.ts +0 -2
  9. package/.storybook/docs/blocks/ImportStatement.tsx +0 -52
  10. package/.storybook/docs/blocks/index.ts +0 -1
  11. package/.storybook/docs/page.tsx +0 -41
  12. package/.storybook/main.ts +0 -21
  13. package/.storybook/postcss.config.cjs +0 -8
  14. package/.storybook/preview-body.html +0 -20
  15. package/.storybook/preview-head.html +0 -6
  16. package/.storybook/preview.tsx +0 -30
  17. package/.storybook/tailwind.css +0 -6
  18. package/.storybook/utils/index.ts +0 -2
  19. package/.storybook/utils/renderAsReact.tsx +0 -30
  20. package/.storybook/utils/renderDocsWithProps.tsx +0 -22
  21. package/@types/markdown.d.ts +0 -4
  22. package/eslint.config.js +0 -91
  23. package/postcss.config.cjs +0 -8
  24. package/scripts/release.sh +0 -76
  25. package/src/components/Button/Button.stories.tsx +0 -314
  26. package/src/components/Button/Button.tsx +0 -132
  27. package/src/components/Button/index.ts +0 -2
  28. package/src/components/Button/types.ts +0 -19
  29. package/src/components/Checkbox/Checkbox.stories.tsx +0 -152
  30. package/src/components/Checkbox/Checkbox.tsx +0 -90
  31. package/src/components/Checkbox/index.ts +0 -2
  32. package/src/components/Checkbox/types.ts +0 -6
  33. package/src/components/Chip/Chip.stories.tsx +0 -146
  34. package/src/components/Chip/Chip.tsx +0 -59
  35. package/src/components/Chip/index.ts +0 -2
  36. package/src/components/Chip/types.ts +0 -6
  37. package/src/components/Drawer/Drawer.docs.md +0 -88
  38. package/src/components/Drawer/Drawer.stories.tsx +0 -239
  39. package/src/components/Drawer/Drawer.tsx +0 -194
  40. package/src/components/Drawer/index.ts +0 -3
  41. package/src/components/Drawer/types.ts +0 -3
  42. package/src/components/Dropdown/AsyncDropdown.tsx +0 -105
  43. package/src/components/Dropdown/Dropdown.docs.md +0 -33
  44. package/src/components/Dropdown/Dropdown.stories.tsx +0 -419
  45. package/src/components/Dropdown/Dropdown.tsx +0 -104
  46. package/src/components/Dropdown/MultiValue.tsx +0 -19
  47. package/src/components/Dropdown/ValueContainer.tsx +0 -114
  48. package/src/components/Dropdown/index.ts +0 -4
  49. package/src/components/Dropdown/types.ts +0 -29
  50. package/src/components/Dropdown/useDropdown.tsx +0 -257
  51. package/src/components/Logo/Logo.stories.tsx +0 -130
  52. package/src/components/Logo/Logo.tsx +0 -80
  53. package/src/components/Logo/index.ts +0 -2
  54. package/src/components/Modal/Modal.docs.md +0 -94
  55. package/src/components/Modal/Modal.stories.tsx +0 -318
  56. package/src/components/Modal/Modal.tsx +0 -217
  57. package/src/components/Modal/index.ts +0 -1
  58. package/src/components/MultiSelect/AsyncMultiSelect.tsx +0 -47
  59. package/src/components/MultiSelect/MultiSelect.docs.md +0 -37
  60. package/src/components/MultiSelect/MultiSelect.stories.tsx +0 -493
  61. package/src/components/MultiSelect/MultiSelect.tsx +0 -81
  62. package/src/components/MultiSelect/index.ts +0 -2
  63. package/src/components/Notification/Notification.stories.tsx +0 -158
  64. package/src/components/Notification/Notification.tsx +0 -110
  65. package/src/components/Notification/index.ts +0 -1
  66. package/src/components/Notification/types.ts +0 -11
  67. package/src/components/Notifications/Notifications.docs.md +0 -103
  68. package/src/components/Notifications/Notifications.stories.tsx +0 -159
  69. package/src/components/Notifications/Notifications.tsx +0 -90
  70. package/src/components/Notifications/NotificationsContext.tsx +0 -90
  71. package/src/components/Notifications/index.ts +0 -7
  72. package/src/components/Select/Select.stories.tsx +0 -234
  73. package/src/components/Select/Select.tsx +0 -129
  74. package/src/components/Select/index.ts +0 -2
  75. package/src/components/Select/types.ts +0 -1
  76. package/src/components/Spinner/Spinner.stories.tsx +0 -55
  77. package/src/components/Spinner/Spinner.tsx +0 -48
  78. package/src/components/Spinner/index.ts +0 -2
  79. package/src/components/Spinner/types.ts +0 -8
  80. package/src/components/TextArea/TextArea.stories.tsx +0 -243
  81. package/src/components/TextArea/TextArea.tsx +0 -133
  82. package/src/components/TextArea/index.ts +0 -2
  83. package/src/components/TextArea/types.ts +0 -4
  84. package/src/components/TextField/Container.tsx +0 -68
  85. package/src/components/TextField/ErrorMessage.tsx +0 -37
  86. package/src/components/TextField/Icon.tsx +0 -77
  87. package/src/components/TextField/Label.tsx +0 -56
  88. package/src/components/TextField/NotchBorder.tsx +0 -67
  89. package/src/components/TextField/index.ts +0 -14
  90. package/src/components/TextField/types.ts +0 -15
  91. package/src/components/TextField/useInputKeyboardFocus.tsx +0 -63
  92. package/src/components/TextInput/TextInput.stories.tsx +0 -384
  93. package/src/components/TextInput/TextInput.tsx +0 -255
  94. package/src/components/TextInput/index.ts +0 -2
  95. package/src/components/TextInput/types.ts +0 -4
  96. package/src/components/Toggle/Toggle.stories.tsx +0 -142
  97. package/src/components/Toggle/Toggle.tsx +0 -69
  98. package/src/components/Toggle/index.ts +0 -1
  99. package/src/hooks/index.ts +0 -6
  100. package/src/hooks/useCombinedRefs.ts +0 -37
  101. package/src/hooks/useEventListener.ts +0 -87
  102. package/src/hooks/useFocusTrap/createAriaHider.ts +0 -62
  103. package/src/hooks/useFocusTrap/index.ts +0 -1
  104. package/src/hooks/useFocusTrap/scopeTab.ts +0 -46
  105. package/src/hooks/useFocusTrap/tabbable.ts +0 -107
  106. package/src/hooks/useFocusTrap/useFocusTrap.ts +0 -97
  107. package/src/hooks/useIsomorphicLayoutEffect.ts +0 -14
  108. package/src/hooks/useLockBodyScroll.ts +0 -24
  109. package/src/hooks/useOnClickOutside.ts +0 -53
  110. package/src/index.ts +0 -22
  111. package/src/tailwind.css +0 -4
  112. package/src/types/helpers.ts +0 -11
  113. package/src/types/polymorphic.ts +0 -39
  114. package/src/utils/animation/variants.ts +0 -21
  115. package/src/utils/array/index.ts +0 -1
  116. package/src/utils/array/uniqBy.ts +0 -12
  117. package/src/utils/common/index.ts +0 -1
  118. package/src/utils/common/isFunction.ts +0 -17
  119. package/src/utils/react/extractDisplayName.ts +0 -15
  120. package/src/utils/react/index.ts +0 -1
  121. package/tsconfig.json +0 -16
  122. package/tsconfig.production.json +0 -19
  123. package/tsup.config.ts +0 -16
@@ -1,44 +0,0 @@
1
- import React, { HTMLAttributes } from "react"
2
-
3
- // Utils
4
- import { clsx } from "clsx"
5
-
6
- // Params
7
- interface Props extends HTMLAttributes<HTMLButtonElement> {
8
- type?: React.JSX.IntrinsicElements["button"]["type"]
9
- }
10
-
11
- /*
12
-
13
-
14
-
15
-
16
- */
17
-
18
- const StorybookActionButton = React.forwardRef<HTMLButtonElement, Props>(
19
- ({ className, children, ...rest }, ref) => {
20
- return (
21
- <button
22
- className={clsx("bg-surface-20 hover:bg-surface-50", className)}
23
- ref={ref}
24
- style={{
25
- position: "relative",
26
- padding: 14,
27
- borderRadius: 9999,
28
- border: "none",
29
- cursor: "pointer",
30
- minWidth: 64,
31
- fontSize: 13.3333,
32
- // color: "ButtonText",
33
- fontFamily: "Arial, sans-serif",
34
- transition: ".1s ease-in-out",
35
- }}
36
- {...rest}
37
- >
38
- {children}
39
- </button>
40
- )
41
- },
42
- )
43
-
44
- export default StorybookActionButton
@@ -1,47 +0,0 @@
1
- import React from "react"
2
-
3
- /*
4
-
5
-
6
-
7
-
8
-
9
- */
10
-
11
- export function DummyPhoneIcon(props: React.SVGProps<SVGSVGElement>) {
12
- return (
13
- <svg
14
- xmlns="http://www.w3.org/2000/svg"
15
- viewBox="0 0 20 20"
16
- fill="currentColor"
17
- aria-hidden="true"
18
- {...props}
19
- >
20
- <path
21
- fillRule="evenodd"
22
- d="M2 3.5A1.5 1.5 0 0 1 3.5 2h1.148a1.5 1.5 0 0 1 1.465 1.175l.716 3.223a1.5 1.5 0 0 1-1.052 1.767l-.933.267c-.41.117-.643.555-.48.95a11.542 11.542 0 0 0 6.254 6.254c.395.163.833-.07.95-.48l.267-.933a1.5 1.5 0 0 1 1.767-1.052l3.223.716A1.5 1.5 0 0 1 18 15.352V16.5a1.5 1.5 0 0 1-1.5 1.5H15c-1.149 0-2.263-.15-3.326-.43A13.022 13.022 0 0 1 2.43 8.326 13.019 13.019 0 0 1 2 5V3.5Z"
23
- clipRule="evenodd"
24
- />
25
- </svg>
26
- )
27
- }
28
-
29
- export function DummyChevronDownIcon(props: React.SVGProps<SVGSVGElement>) {
30
- return (
31
- <svg
32
- width="20"
33
- height="20"
34
- viewBox="0 0 20 20"
35
- fill="none"
36
- xmlns="http://www.w3.org/2000/svg"
37
- {...props}
38
- >
39
- <path
40
- fillRule="evenodd"
41
- clipRule="evenodd"
42
- d="M5.21967 8.21967C5.51256 7.92678 5.98744 7.92678 6.28033 8.21967L10 11.9393L13.7197 8.21967C14.0126 7.92678 14.4874 7.92678 14.7803 8.21967C15.0732 8.51256 15.0732 8.98744 14.7803 9.28033L10.5303 13.5303C10.3897 13.671 10.1989 13.75 10 13.75C9.80109 13.75 9.61032 13.671 9.46967 13.5303L5.21967 9.28033C4.92678 8.98744 4.92678 8.51256 5.21967 8.21967Z"
43
- fill="currentColor"
44
- />
45
- </svg>
46
- )
47
- }
@@ -1,2 +0,0 @@
1
- export { DummyPhoneIcon, DummyChevronDownIcon } from "./DummyIcons"
2
- export { default as StorybookActionButton } from "./ActionButton"
@@ -1,52 +0,0 @@
1
- import React from "react"
2
-
3
- // Components
4
- import { Source, useOf } from "@storybook/addon-docs/blocks"
5
-
6
- // Helpers
7
- const getStoryName = (name?: string): string | undefined => name?.split("/").pop()
8
-
9
- // Props
10
- export interface ImportStatementProps {
11
- source?: string
12
- override?: string
13
- }
14
-
15
- /*
16
-
17
-
18
-
19
-
20
- */
21
-
22
- const ImportStatement: React.FC<ImportStatementProps> = ({ source, override }) => {
23
- const { story } = useOf<"story">("story")
24
-
25
- const componentName = getStoryName(story.title)
26
-
27
- const importStatement = override ?? `import { ${componentName} } from '@bronzelabs/oakma-ui';`
28
-
29
- if (!componentName) {
30
- return null
31
- }
32
-
33
- return (
34
- <div className="mx-0 my-6 flex flex-col gap-2">
35
- <a
36
- className="self-end text-sm"
37
- style={{ color: "#0000ff" }}
38
- href={`https://github.com/BronzeLabs/oakma-ui${
39
- source ?? `/tree/master/src/components/${componentName}`
40
- }`}
41
- target="_blank"
42
- >
43
- View Source
44
- </a>
45
- <div id="import-src">
46
- <Source code={importStatement} />
47
- </div>
48
- </div>
49
- )
50
- }
51
-
52
- export default ImportStatement
@@ -1 +0,0 @@
1
- export { default as ImportStatement } from "./ImportStatement"
@@ -1,41 +0,0 @@
1
- import React from "react"
2
-
3
- // Components
4
- import {
5
- Title,
6
- Subtitle,
7
- Description,
8
- Primary,
9
- Controls,
10
- Stories,
11
- Markdown,
12
- } from "@storybook/addon-docs/blocks"
13
- import ImportStatement, { type ImportStatementProps } from "./blocks/ImportStatement"
14
-
15
- // Props
16
- export interface DocsProps {
17
- importStatementProps?: ImportStatementProps
18
- extraDocs?: string
19
- }
20
-
21
- /*
22
-
23
-
24
-
25
-
26
- */
27
-
28
- const Docs: React.FC<DocsProps> = ({ importStatementProps, extraDocs }) => (
29
- <>
30
- <Title />
31
- <Subtitle />
32
- <ImportStatement {...importStatementProps} />
33
- <Description />
34
- <Primary />
35
- <Controls />
36
- <Stories />
37
- {extraDocs && <Markdown>{extraDocs}</Markdown>}
38
- </>
39
- )
40
-
41
- export default Docs
@@ -1,21 +0,0 @@
1
- import type { StorybookConfig } from "@storybook/react-webpack5"
2
-
3
- const config: StorybookConfig = {
4
- stories: ["../src/**/*.stories.@(js|jsx|ts|tsx)"],
5
- addons: [
6
- "@storybook/addon-webpack5-compiler-swc",
7
- "@storybook/addon-a11y",
8
- "@storybook/addon-docs",
9
- "@storybook/addon-onboarding",
10
- ],
11
- framework: "@storybook/react-webpack5",
12
- webpackFinal: async config => {
13
- config.module?.rules?.forEach((rule: any) => {
14
- if (rule && typeof rule === "object" && rule.test?.test?.("test.css")) {
15
- rule.use?.push("postcss-loader")
16
- }
17
- })
18
- return config
19
- },
20
- }
21
- export default config
@@ -1,8 +0,0 @@
1
- /** @type {import('postcss-load-config').Config} */
2
- const config = {
3
- plugins: {
4
- "@tailwindcss/postcss": {},
5
- },
6
- }
7
-
8
- module.exports = config
@@ -1,20 +0,0 @@
1
- <style>
2
- html {
3
- font-size: 16px;
4
- }
5
-
6
- .docs-story {
7
- background: #ffffff;
8
- }
9
-
10
- @media (prefers-color-scheme: dark) {
11
- .docs-story,
12
- .sb-main-centered {
13
- background: #0f212b;
14
- }
15
- }
16
-
17
- #import-src .docblock-source.sb-unstyled {
18
- margin: 0 !important;
19
- }
20
- </style>
@@ -1,6 +0,0 @@
1
- <link rel="preconnect" href="https://fonts.googleapis.com" />
2
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
3
- <link
4
- href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Lora:ital,wght@0,400..700;1,400..700&display=swap"
5
- rel="stylesheet"
6
- />
@@ -1,30 +0,0 @@
1
- import type { Preview } from "@storybook/react-webpack5"
2
-
3
- // Styles
4
- // @ts-ignore
5
- import "./tailwind.css"
6
-
7
- // Components
8
- import Docs from "./docs/page"
9
-
10
- const preview: Preview = {
11
- parameters: {
12
- layout: "centered",
13
- docs: {
14
- page: Docs,
15
- source: {
16
- excludeDecorators: true,
17
- },
18
- },
19
- controls: {
20
- matchers: {
21
- color: /(background|color)$/i,
22
- date: /Date$/i,
23
- },
24
- },
25
- },
26
-
27
- tags: ["autodocs"],
28
- }
29
-
30
- export default preview
@@ -1,6 +0,0 @@
1
- @import "tailwindcss";
2
- @import "@bronzelabs/oakma-tailwind-preset";
3
-
4
- html {
5
- font-family: var(--font-inter);
6
- }
@@ -1,2 +0,0 @@
1
- export { renderAsReact } from "./renderAsReact"
2
- export { renderDocsWithProps } from "./renderDocsWithProps"
@@ -1,30 +0,0 @@
1
- import React from "react"
2
-
3
- // Types
4
- import type { StoryFn } from "@storybook/react"
5
-
6
- /**
7
- * This occasionally needs to be added as a decorator to make Reacty-y stuff work
8
- * in stories.Unless the story itself is called as a React component storybook will
9
- * bypass React...
10
- *
11
- * This is a helpful explanation: https://stackoverflow.com/a/74281976
12
- *
13
- * @param {StoryFn} Story
14
- * @param {any} args
15
- * @returns {React.JSX.Element}
16
- */
17
-
18
- /*
19
-
20
-
21
-
22
-
23
- */
24
-
25
- const renderAsReact = (Story: StoryFn, args: any): React.JSX.Element => {
26
- const Component = Story as unknown as React.ComponentType
27
- return <Component {...args} />
28
- }
29
-
30
- export { renderAsReact }
@@ -1,22 +0,0 @@
1
- import React from "react"
2
-
3
- // Components
4
- import Docs from "../docs/page"
5
-
6
- // Types
7
- import type { DocsProps } from "../docs/page"
8
-
9
- /*
10
-
11
-
12
-
13
-
14
- */
15
-
16
- const renderDocsWithProps =
17
- (props: DocsProps = {}) =>
18
- () => {
19
- return <Docs {...props} />
20
- }
21
-
22
- export { renderDocsWithProps }
@@ -1,4 +0,0 @@
1
- declare module "*.md" {
2
- const value: string
3
- export default value
4
- }
package/eslint.config.js DELETED
@@ -1,91 +0,0 @@
1
- // For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2
- import storybook from "eslint-plugin-storybook"
3
-
4
- import tseslint from "typescript-eslint"
5
- import reactPlugin from "eslint-plugin-react"
6
- import reactHooksPlugin from "eslint-plugin-react-hooks"
7
- import importPlugin from "eslint-plugin-import-x"
8
- import betterTailwindcss from "eslint-plugin-better-tailwindcss"
9
-
10
- export default tseslint.config(
11
- { ignores: ["dist/**", "node_modules/**"] },
12
- {
13
- files: ["**/*.ts", "**/*.tsx"],
14
- extends: [tseslint.configs.recommended],
15
- plugins: {
16
- react: reactPlugin,
17
- "react-hooks": reactHooksPlugin,
18
- import: importPlugin,
19
- "better-tailwindcss": betterTailwindcss,
20
- },
21
- settings: {
22
- react: {
23
- version: "detect",
24
- },
25
- "better-tailwindcss": {
26
- entryPoint: "./src/tailwind.css",
27
- },
28
- },
29
- rules: {
30
- ...reactPlugin.configs.recommended.rules,
31
- ...reactHooksPlugin.configs.recommended.rules,
32
-
33
- "no-param-reassign": [2, { props: false }],
34
- "no-console": 0,
35
- "consistent-return": 0,
36
- "no-nested-ternary": 0,
37
- "no-constant-condition": [2, { checkLoops: false }],
38
-
39
- // Import
40
- "import/newline-after-import": 2,
41
- "import/no-duplicates": 2,
42
- "import/no-useless-path-segments": 1,
43
- "import/order": 0,
44
- "import/prefer-default-export": 0,
45
- "import/extensions": 0,
46
- "import/no-named-as-default-member": 0,
47
- "import/no-cycle": 2,
48
-
49
- // React
50
- "react/react-in-jsx-scope": 0,
51
- "react/prop-types": 0,
52
- "react/jsx-props-no-spreading": 0,
53
- "react/jsx-filename-extension": 0,
54
- "react/no-array-index-key": 1,
55
- "react/display-name": 0,
56
- "react/no-unknown-property": 0,
57
- "react/no-unescaped-entities": 1,
58
- "react/jsx-no-comment-textnodes": 1,
59
- "react/jsx-no-target-blank": 0,
60
-
61
- // TypeScript
62
- "@typescript-eslint/explicit-function-return-type": 0,
63
- "@typescript-eslint/semi": 0,
64
- "@typescript-eslint/no-explicit-any": 0,
65
- "@typescript-eslint/no-inferrable-types": 0,
66
- "@typescript-eslint/ban-ts-comment": 0,
67
- "@typescript-eslint/no-restricted-types": 1,
68
- "@typescript-eslint/no-empty-object-type": 1,
69
- "@typescript-eslint/no-unsafe-function-type": 1,
70
- "@typescript-eslint/no-wrapper-object-types": 1,
71
- "@typescript-eslint/no-unused-vars": 1,
72
- "@typescript-eslint/no-unused-expressions": 0,
73
-
74
- // Tailwind CSS
75
- "better-tailwindcss/enforce-consistent-line-wrapping": 0,
76
- "better-tailwindcss/enforce-consistent-class-order": 0,
77
- "better-tailwindcss/enforce-consistent-variable-syntax": 1,
78
- "better-tailwindcss/enforce-consistent-important-position": 1,
79
- "better-tailwindcss/enforce-shorthand-classes": 0,
80
- "better-tailwindcss/enforce-canonical-classes": 1,
81
- "better-tailwindcss/no-duplicate-classes": 1,
82
- "better-tailwindcss/no-deprecated-classes": 1,
83
- "better-tailwindcss/no-unnecessary-whitespace": 1,
84
- "better-tailwindcss/no-unknown-classes": 0,
85
- "better-tailwindcss/no-restricted-classes": 0,
86
- "better-tailwindcss/no-conflicting-classes": 0,
87
- "better-tailwindcss/sort-classes": 0,
88
- },
89
- },
90
- storybook.configs["flat/recommended"],
91
- )
@@ -1,8 +0,0 @@
1
- /** @type {import('postcss-load-config').Config} */
2
- const config = {
3
- plugins: {
4
- "@tailwindcss/postcss": {},
5
- },
6
- }
7
-
8
- module.exports = config
@@ -1,76 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Function to run a command and check its exit status
4
- run_command() {
5
- "$@"
6
- if [ $? -ne 0 ]; then
7
- echo "Command failed: $@"
8
- exit 1
9
- else
10
- echo "Command succeeded: $@"
11
- fi
12
- }
13
-
14
- # Navigate to tribe tailwind preset
15
- cd /Users/nathanhughes/Documents/Projects/Oakma/oakma-ui
16
-
17
- # Get current version
18
- current_version=$(node -p "require('./package.json').version")
19
-
20
- echo "Current version: $current_version"
21
- echo ""
22
- echo "Select release option:"
23
- echo "1) patch (e.g., $current_version -> $(node -p "'$current_version'.split('.').map((n,i)=>i===2?+n+1:n).join('.')"))"
24
- echo "2) minor (e.g., $current_version -> $(node -p "'$current_version'.split('.').map((n,i)=>i===1?+n+1:i===2?0:n).join('.')"))"
25
- echo "3) major (e.g., $current_version -> $(node -p "'$current_version'.split('.').map((n,i)=>i===0?+n+1:0).join('.')"))"
26
- echo "4) Enter custom version"
27
- read -p "Enter your choice (1, 2, 3, or 4): " choice
28
-
29
- case $choice in
30
- 1)
31
- bump_type="patch"
32
- run_command npm version $bump_type --no-git-tag-version
33
- ;;
34
- 2)
35
- bump_type="minor"
36
- run_command npm version $bump_type --no-git-tag-version
37
- ;;
38
- 3)
39
- bump_type="major"
40
- run_command npm version $bump_type --no-git-tag-version
41
- ;;
42
- 4)
43
- read -p "Enter the new version (e.g., 2.0.0): " custom_version
44
- run_command npm version $custom_version --no-git-tag-version
45
- ;;
46
- *)
47
- echo "Invalid choice"
48
- exit 1
49
- ;;
50
- esac
51
-
52
- # Get the new version
53
- new_version=$(node -p "require('./package.json').version")
54
-
55
- echo ""
56
- echo "New version will be: $new_version"
57
- read -p "Proceed with publishing? (y/n): " confirm
58
-
59
- if [ "$confirm" != "y" ]; then
60
- echo "Publish cancelled"
61
- exit 1
62
- fi
63
-
64
- # Publish the package
65
- run_command npm publish
66
-
67
- # Commit the changes
68
- run_command git add .
69
- run_command git commit -m "oakma-ui v$new_version" --no-verify
70
- run_command git tag "oakma-ui/v$new_version"
71
- run_command git push --no-verify
72
- run_command git push --tags --no-verify
73
-
74
- echo "oakma-ui v$new_version has been published!"
75
-
76
- exit 0